From c2a08b8192b3914b1a27d0c1639b7f4841281b77 Mon Sep 17 00:00:00 2001 From: Justin Kulikauskas Date: Thu, 29 Feb 2024 15:03:59 -0500 Subject: [PATCH] Change undetermined OperatorPolicy names to '-' Previously they were '*', but '-' might be more familiar to users. Refs: - https://issues.redhat.com/browse/ACM-10202 Signed-off-by: Justin Kulikauskas --- api/v1/configurationpolicy_types.go | 2 +- controllers/operatorpolicy_status.go | 6 +++--- test/e2e/case38_install_operator_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/v1/configurationpolicy_types.go b/api/v1/configurationpolicy_types.go index ada14940..9411ab40 100644 --- a/api/v1/configurationpolicy_types.go +++ b/api/v1/configurationpolicy_types.go @@ -328,7 +328,7 @@ type ObjectResource struct { func ObjectResourceFromObj(obj client.Object) ObjectResource { name := obj.GetName() if name == "" { - name = "*" + name = "-" } return ObjectResource{ diff --git a/controllers/operatorpolicy_status.go b/controllers/operatorpolicy_status.go index 07197931..6d1f70f8 100644 --- a/controllers/operatorpolicy_status.go +++ b/controllers/operatorpolicy_status.go @@ -766,7 +766,7 @@ func noInstallPlansObj(namespace string) policyv1.RelatedObject { Kind: installPlanGVK.Kind, APIVersion: installPlanGVK.GroupVersion().String(), Metadata: policyv1.ObjectMetadata{ - Name: "*", + Name: "-", Namespace: namespace, }, }, @@ -839,7 +839,7 @@ var noExistingCSVObj = policyv1.RelatedObject{ Kind: clusterServiceVersionGVK.Kind, APIVersion: clusterServiceVersionGVK.GroupVersion().String(), Metadata: policyv1.ObjectMetadata{ - Name: "*", + Name: "-", }, }, Compliant: string(policyv1.UnknownCompliancy), @@ -886,7 +886,7 @@ var noExistingDeploymentObj = policyv1.RelatedObject{ Kind: deploymentGVK.Kind, APIVersion: deploymentGVK.GroupVersion().String(), Metadata: policyv1.ObjectMetadata{ - Name: "*", + Name: "-", }, }, Compliant: string(policyv1.UnknownCompliancy), diff --git a/test/e2e/case38_install_operator_test.go b/test/e2e/case38_install_operator_test.go index 2f5ebdbd..3820afd0 100644 --- a/test/e2e/case38_install_operator_test.go +++ b/test/e2e/case38_install_operator_test.go @@ -135,7 +135,7 @@ var _ = Describe("Test installing an operator from OperatorPolicy", Ordered, fun Kind: "OperatorGroup", APIVersion: "operators.coreos.com/v1", Metadata: policyv1.ObjectMetadata{ - Name: "*", + Name: "-", Namespace: opPolTestNS, }, }, @@ -953,7 +953,7 @@ var _ = Describe("Test installing an operator from OperatorPolicy", Ordered, fun APIVersion: "operators.coreos.com/v1alpha1", Metadata: policyv1.ObjectMetadata{ Namespace: opPolTestNS, - Name: "*", + Name: "-", }, }, Compliant: "Compliant",