Update tests to be compatible with CR > v0.10.0

Also updates the tests to be compatible with the breaking changes in
controller-runtime > v0.10.0.

Cherry-picked from 467d97a9bf.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
This commit is contained in:
Sunny 2021-10-01 22:52:18 +05:30 committed by Hidde Beydals
parent 1471796252
commit 16690b3fb5
1 changed files with 4 additions and 12 deletions

View File

@ -206,11 +206,9 @@ Images:
},
},
},
Status: imagev1_reflect.ImagePolicyStatus{
LatestImage: "helloworld:v1.0.0",
},
}
Expect(k8sClient.Create(context.Background(), policy)).To(Succeed())
policy.Status.LatestImage = "helloworld:v1.0.0"
Expect(k8sClient.Status().Update(context.Background(), policy)).To(Succeed())
// Format the expected message given the generated values
@ -346,11 +344,9 @@ Images:
},
},
},
Status: imagev1_reflect.ImagePolicyStatus{
LatestImage: "helloworld:v1.0.0",
},
}
Expect(k8sClient.Create(context.Background(), policy)).To(Succeed())
policy.Status.LatestImage = "helloworld:v1.0.0"
Expect(k8sClient.Status().Update(context.Background(), policy)).To(Succeed())
// Insert a setter reference into the deployment file,
@ -475,11 +471,9 @@ Images:
},
},
},
Status: imagev1_reflect.ImagePolicyStatus{
LatestImage: "helloworld:v1.0.0",
},
}
Expect(k8sClient.Create(context.Background(), policy)).To(Succeed())
policy.Status.LatestImage = "helloworld:v1.0.0"
Expect(k8sClient.Status().Update(context.Background(), policy)).To(Succeed())
// Insert a setter reference into the deployment file,
@ -696,11 +690,9 @@ Images:
},
},
},
Status: imagev1_reflect.ImagePolicyStatus{
LatestImage: latestImage,
},
}
Expect(k8sClient.Create(context.Background(), policy)).To(Succeed())
policy.Status.LatestImage = latestImage
Expect(k8sClient.Status().Update(context.Background(), policy)).To(Succeed())
})