From 3a98516a080908661da94cd51461b52250a5a459 Mon Sep 17 00:00:00 2001 From: Kevin Conner Date: Tue, 30 Apr 2024 07:56:50 -0700 Subject: [PATCH] Add isError to expected output Signed-off-by: Kevin Conner --- k8s/validatingadmissionpolicy_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/k8s/validatingadmissionpolicy_test.go b/k8s/validatingadmissionpolicy_test.go index e2edf7b..7f855fb 100644 --- a/k8s/validatingadmissionpolicy_test.go +++ b/k8s/validatingadmissionpolicy_test.go @@ -311,11 +311,13 @@ func TestValidationEval(t *testing.T) { Value: "default", Cost: uint64ptr(6), }, { - Name: "containers", - Error: strptr("unexpected error evaluating expression containers: no such key: spc"), + Name: "containers", + IsError: true, + Error: strptr("unexpected error evaluating expression containers: no such key: spc"), }}, Validations: []*k8s.EvalResult{{ - Error: strptr("unexpected error evaluating expression 'variables.foo == 'default' && variables.containers.all(c, c.image.startsWith(\"test\"))', caused by nested exception: 'no such key: spc'"), + IsError: true, + Error: strptr("unexpected error evaluating expression 'variables.foo == 'default' && variables.containers.all(c, c.image.startsWith(\"test\"))', caused by nested exception: 'no such key: spc'"), }}, AuditAnnotations: []*k8s.EvalResult{{ Name: strptr("foo-label"),