From af03bb58228bb64273e9d9e4aa705bb1dd332d5b Mon Sep 17 00:00:00 2001 From: Max Smythe Date: Mon, 23 Jan 2023 18:45:13 -0800 Subject: [PATCH] Fix broken tests Signed-off-by: Max Smythe --- .../constrainttemplate_controller_test.go | 2 +- pkg/target/target_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/controller/constrainttemplate/constrainttemplate_controller_test.go b/pkg/controller/constrainttemplate/constrainttemplate_controller_test.go index a6724c98f2e..861ba86e325 100644 --- a/pkg/controller/constrainttemplate/constrainttemplate_controller_test.go +++ b/pkg/controller/constrainttemplate/constrainttemplate_controller_test.go @@ -580,7 +580,7 @@ violation[{"msg": "denied!"}] { // Set up tracker tracker, err := readiness.SetupTracker(mgr, false, false) - if err != nil { + if err != nil && !strings.Contains(err.Error(), "unable to add new checker because healthz endpoint has already been created") { t.Fatal(err) } diff --git a/pkg/target/target_test.go b/pkg/target/target_test.go index 33fececaeee..9d5c37bb09a 100644 --- a/pkg/target/target_test.go +++ b/pkg/target/target_test.go @@ -90,7 +90,7 @@ func TestValidateConstraint(t *testing.T) { "matchExpressions": [{ "key": "someKey", "operator": "NotIn", - "values": ["some value"] + "values": ["some-value"] }] } }, @@ -130,7 +130,7 @@ func TestValidateConstraint(t *testing.T) { ErrorExpected: true, }, { - Name: "Invalid LabelSelector MatchLels", + Name: "Invalid LabelSelector MatchLabels", Constraint: ` { "apiVersion": "constraints.gatekeeper.sh/v1beta1", @@ -212,7 +212,7 @@ func TestValidateConstraint(t *testing.T) { "matchExpressions": [{ "key": "someKey", "operator": "In", - "values": ["some value"] + "values": ["some-value"] }] } }, @@ -245,7 +245,7 @@ func TestValidateConstraint(t *testing.T) { "matchExpressions": [{ "key": "someKey", "operator": "In", - "values": ["some value"] + "values": ["some-value"] }] } },