Skip to content

Commit

Permalink
fix pararrel hetznerbaremetalmachine test issue
Browse files Browse the repository at this point in the history
Signed-off-by: Aniruddha Basak <[email protected]>
  • Loading branch information
aniruddha2000 committed Oct 14, 2023
1 parent a55ac7f commit 7718238
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions controllers/hetznerbaremetalremediation_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
})
Expand Down

0 comments on commit 7718238

Please sign in to comment.