Skip to content

Commit

Permalink
PLT-827: repeated types collapse.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikchern committed Nov 22, 2023
1 parent 4f53362 commit c1ea929
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ type V1Client struct {
DeleteOciEcrRegistryFn func(uid string) error

// Edge Native
GetCloudConfigEdgeNativeFn func(uid string, clusterContext string) (*models.V1EdgeNativeCloudConfig, error)
GetCloudConfigEdgeNativeFn func(uid, clusterContext string) (*models.V1EdgeNativeCloudConfig, error)
}

func New(hubbleHost, email, password, projectUID, apikey string, transportDebug bool, retryAttempts int) *V1Client {
Expand Down
4 changes: 2 additions & 2 deletions client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (h *V1Client) GetClusterAdminKubeConfig(uid, ClusterContext string) (string
return builder.String(), nil
}

func (h *V1Client) GetClusterImportManifest(uid string, clusterContext string) (string, error) {
func (h *V1Client) GetClusterImportManifest(uid, clusterContext string) (string, error) {
client, err := h.GetClusterClient()
if err != nil {
return "", err
Expand All @@ -306,7 +306,7 @@ func (h *V1Client) GetClusterImportManifest(uid string, clusterContext string) (
return builder.String(), nil
}

func (h *V1Client) UpdateClusterProfileValues(uid string, context string, profiles *models.V1SpectroClusterProfiles) error {
func (h *V1Client) UpdateClusterProfileValues(uid, context string, profiles *models.V1SpectroClusterProfiles) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_aks.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (h *V1Client) GetCloudConfigAks(configUID, ClusterContext string) (*models.
return success.Payload, nil
}

func (h *V1Client) GetNodeStatusMapAks(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapAks(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (h *V1Client) ImportClusterAws(meta *models.V1ObjectMetaInputEntity) (strin
return *success.Payload.UID, nil
}

func (h *V1Client) GetNodeStatusMapAws(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapAws(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (h *V1Client) ImportClusterAzure(meta *models.V1ObjectMetaInputEntity) (str
return *success.Payload.UID, nil
}

func (h *V1Client) GetNodeStatusMapAzure(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapAzure(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_coxedge.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (h *V1Client) GetCloudConfigCoxEdge(configUID, ClusterContext string) (*mod
return success.Payload, nil
}

func (h *V1Client) GetNodeStatusMapCoxEdge(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapCoxEdge(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (h *V1Client) GetCloudConfigEdge(configUID, ClusterContext string) (*models
return success.Payload, nil
}

func (h *V1Client) GetNodeStatusMapEdge(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapEdge(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_edge_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (h *V1Client) GetCloudConfigEdgeNative(configUID, ClusterContext string) (*
return success.Payload, nil
}

func (h *V1Client) GetNodeStatusMapEdgeNative(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapEdgeNative(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_edge_vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (h *V1Client) ImportClusterEdgeVsphere(meta *models.V1ObjectMetaInputEntity
return *success.Payload.UID, nil
}

func (h *V1Client) GetNodeStatusMapEdgeVsphere(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapEdgeVsphere(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (h *V1Client) GetCloudConfigEks(configUID, ClusterContext string) (*models.
return success.Payload, nil
}

func (h *V1Client) GetNodeStatusMapEks(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapEks(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (h *V1Client) ImportClusterGcp(meta *models.V1ObjectMetaInputEntity) (strin
return *success.Payload.UID, nil
}

func (h *V1Client) GetNodeStatusMapGcp(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapGcp(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (h *V1Client) UpdateClusterGroup(uid string, clusterGroup *models.V1Cluster
return err
}

func (h *V1Client) UpdateClusterProfileInClusterGroup(clusterGroupContext string, clusterGroupUid string, clusterProfiles *models.V1SpectroClusterProfiles) error {
func (h *V1Client) UpdateClusterProfileInClusterGroup(clusterGroupContext, clusterGroupUid string, clusterProfiles *models.V1SpectroClusterProfiles) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions client/cluster_host_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
clusterC "github.com/spectrocloud/hapi/spectrocluster/client/v1"
)

func (h *V1Client) UpdateClusterHostConfig(uid string, clusterContext string, config *models.V1HostClusterConfigEntity) error {
func (h *V1Client) UpdateClusterHostConfig(uid, clusterContext string, config *models.V1HostClusterConfigEntity) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand All @@ -21,7 +21,7 @@ func (h *V1Client) UpdateClusterHostConfig(uid string, clusterContext string, co
return err
}

func (h *V1Client) ApplyClusterHostConfig(uid string, clusterContext string, config *models.V1HostClusterConfigEntity) error {
func (h *V1Client) ApplyClusterHostConfig(uid, clusterContext string, config *models.V1HostClusterConfigEntity) error {
if policy, err := h.GetClusterScanConfig(uid, clusterContext); err != nil {
return err
} else if policy == nil {
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (h *V1Client) GetCloudConfigLibvirt(configUID, ClusterContext string) (*mod
return success.Payload, nil
}

func (h *V1Client) GetNodeStatusMapLibvirt(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapLibvirt(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_location_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (h *V1Client) GetClusterLocationConfig(scope, uid string) (*models.V1Cluste
return nil, errors.New("failed to read cluster location")
}

func (h *V1Client) UpdateClusterLocationConfig(uid string, clusterContext string, config *models.V1SpectroClusterLocationInputEntity) error {
func (h *V1Client) UpdateClusterLocationConfig(uid, clusterContext string, config *models.V1SpectroClusterLocationInputEntity) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_maas.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (h *V1Client) ImportClusterMaas(meta *models.V1ObjectMetaInputEntity) (stri
return *success.Payload.UID, nil
}

func (h *V1Client) GetNodeStatusMapMaas(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapMaas(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions client/cluster_metadata_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
clusterC "github.com/spectrocloud/hapi/spectrocluster/client/v1"
)

func (h *V1Client) UpdateClusterMetadata(uid string, clusterContext string, config *models.V1ObjectMetaInputEntitySchema) error {
func (h *V1Client) UpdateClusterMetadata(uid, clusterContext string, config *models.V1ObjectMetaInputEntitySchema) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand All @@ -24,7 +24,7 @@ func (h *V1Client) UpdateClusterMetadata(uid string, clusterContext string, conf
return err
}

func (h *V1Client) UpdateAdditionalClusterMetadata(uid string, clusterContext string, additionalMeta *models.V1ClusterMetaAttributeEntity) error {
func (h *V1Client) UpdateAdditionalClusterMetadata(uid, clusterContext string, additionalMeta *models.V1ClusterMetaAttributeEntity) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions client/cluster_namespace_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spectrocloud/palette-sdk-go/client/herr"
)

func (h *V1Client) GetClusterNamespaceConfig(uid string, clusterContext string) (*models.V1ClusterNamespaceResources, error) {
func (h *V1Client) GetClusterNamespaceConfig(uid, clusterContext string) (*models.V1ClusterNamespaceResources, error) {
if h.GetClusterNamespaceConfigFn != nil {
return h.GetClusterNamespaceConfigFn(uid)
}
Expand All @@ -33,7 +33,7 @@ func (h *V1Client) GetClusterNamespaceConfig(uid string, clusterContext string)
}

// UpdateClusterNamespaceConfig no create for namespaces, there is only update.
func (h *V1Client) UpdateClusterNamespaceConfig(uid string, clusterContext string, config *models.V1ClusterNamespaceResourcesUpdateEntity) error {
func (h *V1Client) UpdateClusterNamespaceConfig(uid, clusterContext string, config *models.V1ClusterNamespaceResourcesUpdateEntity) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand All @@ -49,7 +49,7 @@ func (h *V1Client) UpdateClusterNamespaceConfig(uid string, clusterContext strin
return err
}

func (h *V1Client) ApplyClusterNamespaceConfig(uid string, clusterContext string, config []*models.V1ClusterNamespaceResourceInputEntity) error {
func (h *V1Client) ApplyClusterNamespaceConfig(uid, clusterContext string, config []*models.V1ClusterNamespaceResourceInputEntity) error {
if _, err := h.GetClusterNamespaceConfig(uid, clusterContext); err != nil {
return err
} else {
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (h *V1Client) ImportClusterOpenStack(meta *models.V1ObjectMetaInputEntity)
return *success.Payload.UID, nil
}

func (h *V1Client) GetNodeStatusMapOpenStack(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapOpenStack(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_ospatch_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
clusterC "github.com/spectrocloud/hapi/spectrocluster/client/v1"
)

func (h *V1Client) UpdateClusterOsPatchConfig(uid string, clusterContext string, config *models.V1OsPatchEntity) error {
func (h *V1Client) UpdateClusterOsPatchConfig(uid, clusterContext string, config *models.V1OsPatchEntity) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions client/cluster_rbac_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (h *V1Client) GetClusterRbacConfig(uid, ClusterContext string) (*models.V1C
return success.Payload, nil
}

func (h *V1Client) CreateClusterRbacConfig(uid string, ClusterContext string, config *models.V1ClusterRbac) error {
func (h *V1Client) CreateClusterRbacConfig(uid, ClusterContext string, config *models.V1ClusterRbac) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand All @@ -53,7 +53,7 @@ func (h *V1Client) CreateClusterRbacConfig(uid string, ClusterContext string, co
return err
}

func (h *V1Client) UpdateClusterRbacConfig(uid string, ClusterContext string, config *models.V1ClusterRbacResourcesUpdateEntity) error {
func (h *V1Client) UpdateClusterRbacConfig(uid, ClusterContext string, config *models.V1ClusterRbacResourcesUpdateEntity) error {
client, err := h.GetClusterClient()
if err != nil {
return err
Expand All @@ -71,7 +71,7 @@ func (h *V1Client) UpdateClusterRbacConfig(uid string, ClusterContext string, co
return err
}

func (h *V1Client) ApplyClusterRbacConfig(uid string, ClusterContext string, config []*models.V1ClusterRbacInputEntity) error {
func (h *V1Client) ApplyClusterRbacConfig(uid, ClusterContext string, config []*models.V1ClusterRbacInputEntity) error {
if rbac, err := h.GetClusterRbacConfig(uid, ClusterContext); err != nil {
return err
} else if rbac == nil {
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_scan_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/spectrocloud/palette-sdk-go/client/herr"
)

func (h *V1Client) GetClusterScanConfig(uid string, clusterContext string) (*models.V1ClusterComplianceScan, error) {
func (h *V1Client) GetClusterScanConfig(uid, clusterContext string) (*models.V1ClusterComplianceScan, error) {
if h.GetClusterScanConfigFn != nil {
return h.GetClusterScanConfigFn(uid)
}
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_tke.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (h *V1Client) GetCloudConfigTke(configUID, ClusterContext string) (*models.
return success.Payload, nil
}

func (h *V1Client) GetNodeStatusMapTke(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapTke(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_virtual.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (h *V1Client) VirtualClusterLifecycleConfigChange(uid string, body *models.
return "Success", nil
}

func (h *V1Client) GetNodeStatusMapVirtual(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapVirtual(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion client/cluster_vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (h *V1Client) ImportClusterVsphere(meta *models.V1ObjectMetaInputEntity) (s
return *success.Payload.UID, nil
}

func (h *V1Client) GetNodeStatusMapVsphere(configUID string, machinePoolName string, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
func (h *V1Client) GetNodeStatusMapVsphere(configUID, machinePoolName, ClusterContext string) (map[string]models.V1CloudMachineStatus, error) {
client, err := h.GetClusterClient()
if err != nil {
return nil, err
Expand Down
Loading

0 comments on commit c1ea929

Please sign in to comment.