diff --git a/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go b/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go index c6e01310a..b0d03536b 100644 --- a/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go +++ b/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go @@ -1171,6 +1171,8 @@ func TestGetTargetsFromMHC(t *testing.T) { machineAnnotationKey: fmt.Sprintf("%s/%s", namespace, "match1"), }, Labels: map[string]string{}, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -1238,6 +1240,8 @@ func TestGetTargetsFromMHC(t *testing.T) { machineAnnotationKey: fmt.Sprintf("%s/%s", namespace, "match1"), }, Labels: map[string]string{}, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -1259,6 +1263,8 @@ func TestGetTargetsFromMHC(t *testing.T) { machineAnnotationKey: fmt.Sprintf("%s/%s", namespace, "match2"), }, Labels: map[string]string{}, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -1300,6 +1306,8 @@ func TestGetTargetsFromMHC(t *testing.T) { Namespace: namespace, Labels: map[string]string{"foo": "bar"}, OwnerReferences: []metav1.OwnerReference{{Kind: "MachineSet"}}, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, Spec: mapiv1beta1.MachineSpec{}, Status: mapiv1beta1.MachineStatus{}, @@ -1402,6 +1410,8 @@ func TestGetNodeFromMachine(t *testing.T) { machineAnnotationKey: fmt.Sprintf("%s/%s", namespace, "machine"), }, Labels: map[string]string{}, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, TypeMeta: metav1.TypeMeta{ Kind: "Node", diff --git a/pkg/controller/nodelink/nodelink_controller_test.go b/pkg/controller/nodelink/nodelink_controller_test.go index 948e9c760..456dbdf46 100644 --- a/pkg/controller/nodelink/nodelink_controller_test.go +++ b/pkg/controller/nodelink/nodelink_controller_test.go @@ -40,6 +40,8 @@ func node(name, providerID string, addresses []corev1.NodeAddress, taints []core ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: metav1.NamespaceNone, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -81,6 +83,8 @@ func machine(name, providerID string, addresses []corev1.NodeAddress, taints []c Kind: ownerControllerKind, }, }, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, TypeMeta: metav1.TypeMeta{ Kind: "Machine", diff --git a/pkg/util/testing/testing.go b/pkg/util/testing/testing.go index c610ef9bc..80c8b578e 100644 --- a/pkg/util/testing/testing.go +++ b/pkg/util/testing/testing.go @@ -118,6 +118,8 @@ func NewMachine(name string, nodeName string) *mapiv1.Machine { Controller: pointer.BoolPtr(true), }, }, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, Spec: mapiv1.MachineSpec{}, } @@ -138,6 +140,8 @@ func NewMachineHealthCheck(name string) *mapiv1.MachineHealthCheck { ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: Namespace, + // the following line is to account for a change in the fake client, see https://github.com/kubernetes-sigs/controller-runtime/pull/1306 + ResourceVersion: "999", }, TypeMeta: metav1.TypeMeta{ Kind: "MachineHealthCheck",