@@ -45,6 +45,11 @@ import (
4545 "sigs.k8s.io/controller-runtime/pkg/client/interceptor"
4646)
4747
48+ const (
49+ machineIDFromStatusUpdate = "machine-id-from-status-update"
50+ cidrFromStatusUpdate = "cidr-from-status-update"
51+ )
52+
4853var _ = Describe ("Fake client" , func () {
4954 var dep * appsv1.Deployment
5055 var dep2 * appsv1.Deployment
@@ -1456,15 +1461,15 @@ var _ = Describe("Fake client", func() {
14561461 cl := NewClientBuilder ().WithStatusSubresource (obj ).WithObjects (obj ).Build ()
14571462 objOriginal := obj .DeepCopy ()
14581463
1459- obj .Spec .PodCIDR = "cidr-from-status-update"
1464+ obj .Spec .PodCIDR = cidrFromStatusUpdate
14601465 obj .Annotations = map [string ]string {
14611466 "some-annotation-key" : "some-annotation-value" ,
14621467 }
14631468 obj .Labels = map [string ]string {
14641469 "some-label-key" : "some-label-value" ,
14651470 }
14661471
1467- obj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1472+ obj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
14681473 Expect (cl .Status ().Update (context .Background (), obj )).NotTo (HaveOccurred ())
14691474
14701475 actual := & corev1.Node {ObjectMeta : metav1.ObjectMeta {Name : obj .Name }}
@@ -1473,7 +1478,7 @@ var _ = Describe("Fake client", func() {
14731478 objOriginal .APIVersion = actual .APIVersion
14741479 objOriginal .Kind = actual .Kind
14751480 objOriginal .ResourceVersion = actual .ResourceVersion
1476- objOriginal .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1481+ objOriginal .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
14771482 Expect (cmp .Diff (objOriginal , actual )).To (BeEmpty ())
14781483 })
14791484
@@ -1494,7 +1499,7 @@ var _ = Describe("Fake client", func() {
14941499 cl := NewClientBuilder ().WithStatusSubresource (obj ).WithObjects (obj ).Build ()
14951500 expectedObj := obj .DeepCopy ()
14961501
1497- obj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1502+ obj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
14981503 Expect (cl .Status ().Update (context .Background (), obj )).NotTo (HaveOccurred ())
14991504
15001505 obj .Annotations = map [string ]string {
@@ -1511,7 +1516,7 @@ var _ = Describe("Fake client", func() {
15111516 expectedObj .APIVersion = actual .APIVersion
15121517 expectedObj .Kind = actual .Kind
15131518 expectedObj .ResourceVersion = actual .ResourceVersion
1514- expectedObj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1519+ expectedObj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
15151520 Expect (cmp .Diff (expectedObj , actual )).To (BeEmpty ())
15161521 })
15171522
@@ -1540,8 +1545,8 @@ var _ = Describe("Fake client", func() {
15401545 }
15411546 Expect (cl .Update (context .Background (), obj )).NotTo (HaveOccurred ())
15421547
1543- obj .Spec .PodCIDR = "cidr-from-status-update"
1544- obj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1548+ obj .Spec .PodCIDR = cidrFromStatusUpdate
1549+ obj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
15451550 Expect (cl .Status ().Update (context .Background (), obj )).NotTo (HaveOccurred ())
15461551
15471552 actual := & corev1.Node {ObjectMeta : metav1.ObjectMeta {Name : obj .Name }}
@@ -1550,7 +1555,7 @@ var _ = Describe("Fake client", func() {
15501555 expectedObj .APIVersion = actual .APIVersion
15511556 expectedObj .Kind = actual .Kind
15521557 expectedObj .ResourceVersion = actual .ResourceVersion
1553- expectedObj .Status .NodeInfo .MachineID = "machine-id-from-status-update"
1558+ expectedObj .Status .NodeInfo .MachineID = machineIDFromStatusUpdate
15541559 Expect (cmp .Diff (expectedObj , actual )).To (BeEmpty ())
15551560 })
15561561
@@ -1614,7 +1619,7 @@ var _ = Describe("Fake client", func() {
16141619 cl := NewClientBuilder ().WithStatusSubresource (obj ).WithObjects (obj ).Build ()
16151620 objOriginal := obj .DeepCopy ()
16161621
1617- obj .Spec .PodCIDR = "cidr-from-status-update"
1622+ obj .Spec .PodCIDR = cidrFromStatusUpdate
16181623 obj .Status .NodeInfo .MachineID = "machine-id"
16191624 Expect (cl .Status ().Patch (context .Background (), obj , client .MergeFrom (objOriginal ))).NotTo (HaveOccurred ())
16201625
0 commit comments