@@ -45,6 +45,8 @@ import (
45
45
"sigs.k8s.io/controller-runtime/pkg/client/interceptor"
46
46
)
47
47
48
+ const machineIDFromStatusUpdate = "machine-id-from-status-update"
49
+
48
50
var _ = Describe ("Fake client" , func () {
49
51
var dep * appsv1.Deployment
50
52
var dep2 * appsv1.Deployment
@@ -1464,7 +1466,7 @@ var _ = Describe("Fake client", func() {
1464
1466
"some-label-key" : "some-label-value" ,
1465
1467
}
1466
1468
1467
- obj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1469
+ obj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
1468
1470
Expect (cl .Status ().Update (context .Background (), obj )).NotTo (HaveOccurred ())
1469
1471
1470
1472
actual := & corev1.Node {ObjectMeta : metav1.ObjectMeta {Name : obj .Name }}
@@ -1473,7 +1475,7 @@ var _ = Describe("Fake client", func() {
1473
1475
objOriginal .APIVersion = actual .APIVersion
1474
1476
objOriginal .Kind = actual .Kind
1475
1477
objOriginal .ResourceVersion = actual .ResourceVersion
1476
- objOriginal .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1478
+ objOriginal .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
1477
1479
Expect (cmp .Diff (objOriginal , actual )).To (BeEmpty ())
1478
1480
})
1479
1481
@@ -1494,7 +1496,7 @@ var _ = Describe("Fake client", func() {
1494
1496
cl := NewClientBuilder ().WithStatusSubresource (obj ).WithObjects (obj ).Build ()
1495
1497
expectedObj := obj .DeepCopy ()
1496
1498
1497
- obj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1499
+ obj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
1498
1500
Expect (cl .Status ().Update (context .Background (), obj )).NotTo (HaveOccurred ())
1499
1501
1500
1502
obj .Annotations = map [string ]string {
@@ -1511,7 +1513,7 @@ var _ = Describe("Fake client", func() {
1511
1513
expectedObj .APIVersion = actual .APIVersion
1512
1514
expectedObj .Kind = actual .Kind
1513
1515
expectedObj .ResourceVersion = actual .ResourceVersion
1514
- expectedObj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1516
+ expectedObj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
1515
1517
Expect (cmp .Diff (expectedObj , actual )).To (BeEmpty ())
1516
1518
})
1517
1519
@@ -1541,7 +1543,7 @@ var _ = Describe("Fake client", func() {
1541
1543
Expect (cl .Update (context .Background (), obj )).NotTo (HaveOccurred ())
1542
1544
1543
1545
obj .Spec .PodCIDR = "cidr-from-status-update"
1544
- obj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1546
+ obj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
1545
1547
Expect (cl .Status ().Update (context .Background (), obj )).NotTo (HaveOccurred ())
1546
1548
1547
1549
actual := & corev1.Node {ObjectMeta : metav1.ObjectMeta {Name : obj .Name }}
@@ -1550,7 +1552,7 @@ var _ = Describe("Fake client", func() {
1550
1552
expectedObj .APIVersion = actual .APIVersion
1551
1553
expectedObj .Kind = actual .Kind
1552
1554
expectedObj .ResourceVersion = actual .ResourceVersion
1553
- expectedObj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1555
+ expectedObj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
1554
1556
Expect (cmp .Diff (expectedObj , actual )).To (BeEmpty ())
1555
1557
})
1556
1558
0 commit comments