Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting #7312

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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),

Check warning on line 136 in cmd/eksctl-anywhere/cmd/deletecluster.go

View check run for this annotation

Codecov / codecov/patch

cmd/eksctl-anywhere/cmd/deletecluster.go#L135-L136

Added lines #L135 - L136 were not covered by tests
}
} else {
cluster = &types.Cluster{
Name: clusterSpec.Cluster.Name,
KubeconfigFile: clusterSpec.ManagementCluster.KubeconfigFile,
Name: clusterSpec.Cluster.Name,
KubeconfigFile: clusterSpec.ManagementCluster.KubeconfigFile,

Check warning on line 141 in cmd/eksctl-anywhere/cmd/deletecluster.go

View check run for this annotation

Codecov / codecov/patch

cmd/eksctl-anywhere/cmd/deletecluster.go#L140-L141

Added lines #L140 - L141 were not covered by tests
}
}

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 @@
}

return &types.Cluster{
Name: kc.Clusters[0].Name,
KubeconfigFile: kubeconfig,
Name: kc.Clusters[0].Name,
KubeconfigFile: kubeconfig,

Check warning on line 41 in pkg/cluster/load.go

View check run for this annotation

Codecov / codecov/patch

pkg/cluster/load.go#L40-L41

Added lines #L40 - L41 were not covered by tests
}, 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