Skip to content

Commit

Permalink
m Fix formatting (#7312)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude authored Jan 17, 2024
1 parent 74b9736 commit 87331cd
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 52 deletions.
8 changes: 4 additions & 4 deletions cmd/eksctl-anywhere/cmd/deletecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
52 changes: 26 additions & 26 deletions pkg/providers/tinkerbell/tinkerbell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions pkg/providers/vsphere/vsphere_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/task/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions pkg/workflows/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/certmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
}
4 changes: 2 additions & 2 deletions test/e2e/curatedpackages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
}

Expand Down

0 comments on commit 87331cd

Please sign in to comment.