From 87331cd9e6404155dddeb57bf616589bc315974c Mon Sep 17 00:00:00 2001 From: Mitali Paygude Date: Wed, 17 Jan 2024 11:29:17 -0800 Subject: [PATCH] m Fix formatting (#7312) --- cmd/eksctl-anywhere/cmd/deletecluster.go | 8 ++-- pkg/cluster/load.go | 4 +- pkg/providers/tinkerbell/tinkerbell_test.go | 52 ++++++++++----------- pkg/providers/vsphere/vsphere_test.go | 20 ++++---- pkg/task/task_test.go | 4 +- pkg/workflows/delete_test.go | 8 ++-- test/e2e/certmanager.go | 4 +- test/e2e/curatedpackages.go | 4 +- 8 files changed, 52 insertions(+), 52 deletions(-) diff --git a/cmd/eksctl-anywhere/cmd/deletecluster.go b/cmd/eksctl-anywhere/cmd/deletecluster.go index 762db2f2128f..f38521244c28 100644 --- a/cmd/eksctl-anywhere/cmd/deletecluster.go +++ b/cmd/eksctl-anywhere/cmd/deletecluster.go @@ -132,13 +132,13 @@ func (dc *deleteClusterOptions) deleteCluster(ctx context.Context) error { var cluster *types.Cluster if clusterSpec.ManagementCluster == nil { cluster = &types.Cluster{ - Name: clusterSpec.Cluster.Name, - KubeconfigFile: kubeconfig.FromClusterName(clusterSpec.Cluster.Name), + Name: clusterSpec.Cluster.Name, + KubeconfigFile: kubeconfig.FromClusterName(clusterSpec.Cluster.Name), } } else { cluster = &types.Cluster{ - Name: clusterSpec.Cluster.Name, - KubeconfigFile: clusterSpec.ManagementCluster.KubeconfigFile, + Name: clusterSpec.Cluster.Name, + KubeconfigFile: clusterSpec.ManagementCluster.KubeconfigFile, } } diff --git a/pkg/cluster/load.go b/pkg/cluster/load.go index e6e4523edf07..4f3f440aae68 100644 --- a/pkg/cluster/load.go +++ b/pkg/cluster/load.go @@ -37,7 +37,7 @@ func LoadManagement(kubeconfig string) (*types.Cluster, error) { } return &types.Cluster{ - Name: kc.Clusters[0].Name, - KubeconfigFile: kubeconfig, + Name: kc.Clusters[0].Name, + KubeconfigFile: kubeconfig, }, nil } diff --git a/pkg/providers/tinkerbell/tinkerbell_test.go b/pkg/providers/tinkerbell/tinkerbell_test.go index 2ce1d8968375..dbde03057081 100644 --- a/pkg/providers/tinkerbell/tinkerbell_test.go +++ b/pkg/providers/tinkerbell/tinkerbell_test.go @@ -1132,8 +1132,8 @@ func TestSetupAndValidateCreateWorkloadClusterSuccess(t *testing.T) { clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) @@ -1180,8 +1180,8 @@ func TestSetupAndValidateCreateWorkloadClusterDifferentNamespaceSuccess(t *testi clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) @@ -1226,8 +1226,8 @@ func TestSetupAndValidateCreateWorkloadClusterFailsIfMachineExists(t *testing.T) clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } idx := 0 @@ -1271,8 +1271,8 @@ func TestSetupAndValidateCreateWorkloadClusterFailsIfDatacenterExists(t *testing clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { @@ -1309,8 +1309,8 @@ func TestSetupAndValidateCreateWorkloadClusterFailsIfDatacenterConfigError(t *te clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { @@ -1346,8 +1346,8 @@ func TestSetupAndValidateCreateWorkloadClusterErrorUnprovisionedHardware(t *test clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) @@ -1384,8 +1384,8 @@ func TestSetupAndValidateCreateWorkloadClusterErrorProvisionedHardware(t *testin clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) @@ -1454,8 +1454,8 @@ func TestSetupAndValidateUpgradeWorkloadClusterErrorApplyHardware(t *testing.T) clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } cluster.KubeconfigFile = "kc.kubeconfig" @@ -1492,8 +1492,8 @@ func TestSetupAndValidateUpgradeWorkloadClusterErrorBMC(t *testing.T) { clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } cluster.KubeconfigFile = "kc.kubeconfig" @@ -1533,8 +1533,8 @@ func TestSetupAndValidateCreateWorkloadClusterErrorManagementCluster(t *testing. clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) @@ -1578,8 +1578,8 @@ func TestSetupAndValidateCreateWorkloadClusterErrorUnspecifiedTinkerbellIP(t *te clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) @@ -1619,8 +1619,8 @@ func TestSetupAndValidateCreateWorkloadClusterErrorManagementClusterTinkerbellIP clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) @@ -1663,8 +1663,8 @@ func TestSetupAndValidateCreateWorkloadClusterErrorDifferentTinkerbellIP(t *test clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range machineConfigs { kubectl.EXPECT().SearchTinkerbellMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.TinkerbellMachineConfig{}, nil) diff --git a/pkg/providers/vsphere/vsphere_test.go b/pkg/providers/vsphere/vsphere_test.go index fbe0ee29a7c4..ee247493fedf 100644 --- a/pkg/providers/vsphere/vsphere_test.go +++ b/pkg/providers/vsphere/vsphere_test.go @@ -1570,8 +1570,8 @@ func TestSetupAndValidateCreateWorkloadClusterSuccess(t *testing.T) { clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range clusterSpec.VSphereMachineConfigs { kubectl.EXPECT().SearchVsphereMachineConfig(ctx, config.Name, clusterSpec.ManagementCluster.KubeconfigFile, config.Namespace).Return([]*v1alpha1.VSphereMachineConfig{}, nil) @@ -1600,8 +1600,8 @@ func TestSetupAndValidateCreateWorkloadClusterFailsIfMachineExists(t *testing.T) clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } idx := 0 @@ -1634,8 +1634,8 @@ func TestSetupAndValidateSelfManagedClusterSkipMachineNameValidateSuccess(t *tes provider.ipValidator = ipValidator clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } kubectl.EXPECT().SearchVsphereMachineConfig(context.TODO(), gomock.Any(), gomock.Any(), gomock.Any()).Times(0) @@ -1664,8 +1664,8 @@ func TestSetupAndValidateCreateWorkloadClusterFailsIfDatacenterExists(t *testing clusterSpec.Cluster.SetManagedBy("management-cluster") clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } for _, config := range clusterSpec.VSphereMachineConfigs { @@ -1691,8 +1691,8 @@ func TestSetupAndValidateSelfManagedClusterSkipDatacenterNameValidateSuccess(t * provider.ipValidator = ipValidator clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } kubectl.EXPECT().SearchVsphereMachineConfig(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Times(0) diff --git a/pkg/task/task_test.go b/pkg/task/task_test.go index 0d71c856705f..055d6de7e405 100644 --- a/pkg/task/task_test.go +++ b/pkg/task/task_test.go @@ -170,8 +170,8 @@ func TestTaskRunnerRunTaskWithCheckpointReadFailure(t *testing.T) { func TestUnmarshalTaskCheckpointSuccess(t *testing.T) { testConfigType := types.Cluster{} testTaskCheckpoint := types.Cluster{ - Name: "test-cluster", - KubeconfigFile: "test.kubeconfig", + Name: "test-cluster", + KubeconfigFile: "test.kubeconfig", } if err := task.UnmarshalTaskCheckpoint(testTaskCheckpoint, testConfigType); err != nil { diff --git a/pkg/workflows/delete_test.go b/pkg/workflows/delete_test.go index ad067695f7a9..0a2b80142be2 100644 --- a/pkg/workflows/delete_test.go +++ b/pkg/workflows/delete_test.go @@ -168,8 +168,8 @@ func TestDeleteWorkloadRunSuccess(t *testing.T) { test.expectSetup() test.expectNotToCreateBootstrap() test.clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } test.clusterSpec.Cluster.SetManagedBy(test.clusterSpec.ManagementCluster.Name) test.expectDeleteWorkload(test.clusterSpec.ManagementCluster) @@ -189,8 +189,8 @@ func TestDeleteWorkloadDeletePackageResourceError(t *testing.T) { test.expectSetup() test.expectNotToCreateBootstrap() test.clusterSpec.ManagementCluster = &types.Cluster{ - Name: "management-cluster", - KubeconfigFile: "kc.kubeconfig", + Name: "management-cluster", + KubeconfigFile: "kc.kubeconfig", } test.clusterSpec.Cluster.SetManagedBy(test.clusterSpec.ManagementCluster.Name) test.expectDeleteWorkload(test.clusterSpec.ManagementCluster) diff --git a/test/e2e/certmanager.go b/test/e2e/certmanager.go index b04709abdfdd..38bbbae5eb9b 100644 --- a/test/e2e/certmanager.go +++ b/test/e2e/certmanager.go @@ -38,7 +38,7 @@ func runCertManagerRemoteClusterInstallSimpleFlow(test *framework.MulticlusterE2 func withMgmtClusterSetup(cluster *framework.ClusterE2ETest) *types.Cluster { return &types.Cluster{ - Name: cluster.ClusterName, - KubeconfigFile: filepath.Join(cluster.ClusterName, fmt.Sprintf("%s-eks-a-cluster.kubeconfig", cluster.ClusterName)), + Name: cluster.ClusterName, + KubeconfigFile: filepath.Join(cluster.ClusterName, fmt.Sprintf("%s-eks-a-cluster.kubeconfig", cluster.ClusterName)), } } diff --git a/test/e2e/curatedpackages.go b/test/e2e/curatedpackages.go index c8fc86a7a105..d1738ea71e78 100644 --- a/test/e2e/curatedpackages.go +++ b/test/e2e/curatedpackages.go @@ -217,8 +217,8 @@ func packageBundleURI(version v1alpha1.KubernetesVersion) string { func withMgmtCluster(cluster *framework.ClusterE2ETest) *types.Cluster { return &types.Cluster{ - Name: cluster.ClusterName, - KubeconfigFile: filepath.Join(cluster.ClusterName, fmt.Sprintf("%s-eks-a-cluster.kubeconfig", cluster.ClusterName)), + Name: cluster.ClusterName, + KubeconfigFile: filepath.Join(cluster.ClusterName, fmt.Sprintf("%s-eks-a-cluster.kubeconfig", cluster.ClusterName)), } }