diff --git a/hooks/namespace_test.go b/hooks/namespace_test.go index 12af79f..9e06cf5 100644 --- a/hooks/namespace_test.go +++ b/hooks/namespace_test.go @@ -137,7 +137,7 @@ var _ = Describe("Namespace webhook", func() { Eventually(k8sClient.Create(ctx, sub2)).Should(Succeed()) sub.Labels[constants.LabelParent] = "sub2-of-non-circular-root" - Consistently(k8sClient.Update(ctx, sub)).Should(HaveOccurred()) + Expect(k8sClient.Update(ctx, sub)).To(MatchError("admission webhook \"namespace.accurate.cybozu.io\" denied the request: circular reference is not permitted")) }) It("should deny updating a template namespace that would create a circular reference", func() {