From 8facc812dcfbdbfe92bd5f7aba596964e7199e1f Mon Sep 17 00:00:00 2001 From: Aniruddha Basak Date: Fri, 13 Oct 2023 15:15:33 +0530 Subject: [PATCH] fix pararrel hetznerbaremetalmachine test issue Signed-off-by: Aniruddha Basak --- .../hetznerbaremetalremediation_controller_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/controllers/hetznerbaremetalremediation_controller_test.go b/controllers/hetznerbaremetalremediation_controller_test.go index b78d8138d..4a63905e4 100644 --- a/controllers/hetznerbaremetalremediation_controller_test.go +++ b/controllers/hetznerbaremetalremediation_controller_test.go @@ -89,7 +89,6 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() { } Expect(testEnv.Create(ctx, capiCluster)).To(Succeed()) - hetznerBaremetalMachineName := utils.GenerateName(nil, "hetzner-baremetal-machine-") capiMachineName := utils.GenerateName(nil, "capi-machine-") capiMachine = &clusterv1.Machine{ @@ -106,7 +105,7 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() { InfrastructureRef: corev1.ObjectReference{ APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "HetznerBareMetalMachine", - Name: hetznerBaremetalMachineName, + Name: bmMachineName, Namespace: testNs.Name, }, FailureDomain: &defaultFailureDomain, @@ -138,7 +137,7 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() { hetznerBaremetalMachine = &infrav1.HetznerBareMetalMachine{ ObjectMeta: metav1.ObjectMeta{ - Name: hetznerBaremetalMachineName, + Name: bmMachineName, Namespace: testNs.Name, Labels: map[string]string{ clusterv1.ClusterNameLabel: capiCluster.Name, @@ -215,13 +214,13 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() { osSSHClientAfterInstallImage.On("CheckCloudInitLogsForSigTerm").Return(sshclient.Output{}) osSSHClientAfterInstallImage.On("ResetKubeadm").Return(sshclient.Output{}) osSSHClientAfterInstallImage.On("GetHostName").Return(sshclient.Output{ - StdOut: infrav1.BareMetalHostNamePrefix + hetznerBaremetalMachineName, + StdOut: infrav1.BareMetalHostNamePrefix + bmMachineName, StdErr: "", Err: nil, }) osSSHClientAfterCloudInit.On("Reboot").Return(sshclient.Output{}) osSSHClientAfterCloudInit.On("GetHostName").Return(sshclient.Output{ - StdOut: infrav1.BareMetalHostNamePrefix + hetznerBaremetalMachineName, + StdOut: infrav1.BareMetalHostNamePrefix + bmMachineName, StdErr: "", Err: nil, })