Skip to content

Commit 59ba270

Browse files
authored
cnf-network: fix HostNameLabel issue in ipforwarding tests (#1349)
1 parent ad1dcfb commit 59ba270

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

tests/cnf/core/network/metallb/tests/ip-forwarding.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
185185
By("Creating NMState policy with VLAN interfaces on the second worker node")
186186

187187
nncpPolicy = nmstate.NewPolicyBuilder(APIClient, ipFwdNNCPName,
188-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
188+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
189189
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
190190
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
191191
WithStaticRoute(ipFwdInternalSubnet1, ipFwdFrrRouterIP1, iface1Name, 150, 254).
@@ -250,7 +250,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
250250
By("Creating BGP peers targeting the second worker node")
251251

252252
workerNode1Selector := map[string]string{
253-
netparam.LabelHostName: workerNodeList[1].Definition.Name}
253+
corev1.LabelHostname: workerNodeList[1].Definition.Name}
254254

255255
_, err = metallb.NewBPGPeerBuilder(
256256
APIClient, tsparams.BgpPeerName1, NetConfig.MlbOperatorNamespace,
@@ -323,7 +323,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
323323
By("Enabling IP forwarding on the first VLAN interface via NNCP update")
324324

325325
nncpPolicy = nmstate.NewPolicyBuilder(APIClient, ipFwdNNCPName,
326-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
326+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
327327
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
328328
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
329329
WithOptions(netnmstate.WithInterfaceIPv4Forwarding(iface1Name, true)).
@@ -344,7 +344,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
344344
By("Enabling IP forwarding on both VLAN interfaces via NNCP update")
345345

346346
nncpPolicy = nmstate.NewPolicyBuilder(APIClient, ipFwdNNCPName,
347-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
347+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
348348
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
349349
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
350350
WithOptions(
@@ -368,7 +368,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
368368
By("Disabling IP forwarding on both VLAN interfaces via NNCP update")
369369

370370
nncpPolicy = nmstate.NewPolicyBuilder(APIClient, ipFwdNNCPName,
371-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
371+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
372372
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
373373
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
374374
WithOptions(
@@ -395,7 +395,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
395395
By("Enabling IP forwarding on the first VLAN interface via NNCP update")
396396

397397
nncpPolicy = nmstate.NewPolicyBuilder(APIClient, ipFwdNNCPName,
398-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
398+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
399399
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
400400
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
401401
WithOptions(netnmstate.WithInterfaceIPv4Forwarding(iface1Name, true)).
@@ -414,7 +414,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
414414
workerNode1Name := workerNodeList[1].Definition.Name
415415
_, err = cluster.ExecCmdWithStdout(APIClient, "reboot -f",
416416
metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s",
417-
netparam.LabelHostName, workerNode1Name)})
417+
corev1.LabelHostname, workerNode1Name)})
418418
Expect(err).ToNot(HaveOccurred(), "Failed to reboot worker node %s", workerNode1Name)
419419

420420
By("Waiting for MachineConfigPool to stabilize after reboot")
@@ -452,7 +452,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
452452
By("Creating NMState policy with IPv6 VLAN interfaces on the second worker node")
453453

454454
nncpV6Policy = nmstate.NewPolicyBuilder(APIClient, ipFwdV6NNCPName,
455-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
455+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
456456
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
457457
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
458458
WithStaticRoute(ipFwdV6InternalSubnet1, ipFwdV6FrrRouterIP1, iface1Name, 150, 254).
@@ -517,7 +517,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
517517
By("Creating BGP peers targeting the second worker node with IPv6 addresses")
518518

519519
workerNode1Selector := map[string]string{
520-
netparam.LabelHostName: workerNodeList[1].Definition.Name}
520+
corev1.LabelHostname: workerNodeList[1].Definition.Name}
521521

522522
_, err = metallb.NewBPGPeerBuilder(
523523
APIClient, tsparams.BgpPeerName1, NetConfig.MlbOperatorNamespace,
@@ -583,7 +583,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
583583
By("Attempting to enable IPv6 forwarding on the first VLAN interface via NNCP update")
584584

585585
nncpV6Policy = nmstate.NewPolicyBuilder(APIClient, ipFwdV6NNCPName,
586-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
586+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
587587
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
588588
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
589589
WithOptions(netnmstate.WithInterfaceIPv6Forwarding(iface1Name, true)).
@@ -600,7 +600,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
600600
By("Restoring NNCP by removing IPv6 forwarding configuration")
601601

602602
nncpV6Policy = nmstate.NewPolicyBuilder(APIClient, ipFwdV6NNCPName,
603-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
603+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
604604
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
605605
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
606606
WithStaticRoute(ipFwdV6InternalSubnet1, ipFwdV6FrrRouterIP1, iface1Name, 150, 254).
@@ -616,7 +616,7 @@ var _ = Describe("IP Forwarding per Interface", Ordered,
616616
By("Enabling IPv4 forwarding on the first VLAN interface via NNCP update")
617617

618618
nncpV6Policy = nmstate.NewPolicyBuilder(APIClient, ipFwdV6NNCPName,
619-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
619+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
620620
WithVlanInterfaceIP(secInterfaces[0], ipFwdWorkerVlanIP1, ipFwdV6WorkerVlanIP1, ipFwdVlanID1).
621621
WithVlanInterfaceIP(secInterfaces[1], ipFwdWorkerVlanIP2, ipFwdV6WorkerVlanIP2, ipFwdVlanID2).
622622
WithOptions(netnmstate.WithInterfaceIPv4Forwarding(iface1Name, true)).
@@ -648,7 +648,7 @@ func cleanupIPFwdNNCP(
648648
iface2Name := fmt.Sprintf("%s.%d", secInterfaces[1], vlanID2)
649649

650650
nncpPolicy = nmstate.NewPolicyBuilder(APIClient, nncpName,
651-
map[string]string{netparam.LabelHostName: workerNodeList[1].Definition.Name}).
651+
map[string]string{corev1.LabelHostname: workerNodeList[1].Definition.Name}).
652652
WithAbsentInterface(iface1Name).
653653
WithAbsentInterface(iface2Name)
654654
err := netnmstate.UpdatePolicyAndWaitUntilItsAvailable(netparam.DefaultTimeout, nncpPolicy)

0 commit comments

Comments
 (0)