Skip to content

Commit 1378b0e

Browse files
Use a valid compliance state in a test
Previously, the CRD did not validate the status.compliance field on ConfigurationPolicies, but now it does. The test will now use, and check for, an allowed value on that field. Signed-off-by: Justin Kulikauskas <[email protected]>
1 parent e6933aa commit 1378b0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/e2e/case10_error_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ var _ = Describe("Test error handling", func() {
213213
1, true, defaultTimeoutSeconds)
214214

215215
By("Manually updating the status on the created configuration policy")
216-
compliancePatch := []byte(`[{"op":"add","path":"/status","value":{"compliant":"testing"}}]`)
216+
compliancePatch := []byte(`[{"op":"add","path":"/status","value":{"compliant":"Pending"}}]`)
217217
// can't just use kubectl - status is a sub-resource
218218
cfgInt := clientManagedDynamic.Resource(gvrConfigurationPolicy).Namespace(clusterNamespace)
219219
_, err := cfgInt.Patch(context.TODO(), "case10-config-policy", types.JSONPatchType,
@@ -253,7 +253,7 @@ var _ = Describe("Test error handling", func() {
253253
compState, found, err := unstructured.NestedString(cfgPolicy.Object, "status", "compliant")
254254
Expect(err).ToNot(HaveOccurred())
255255
Expect(found).To(BeTrue())
256-
Expect(compState).To(Equal("testing"))
256+
Expect(compState).To(Equal("Pending"))
257257

258258
By("Re-applying the working policy")
259259
hubApplyPolicy("case10-test-policy",

0 commit comments

Comments
 (0)