From d3b7e82071612f690527874a740120420154bb86 Mon Sep 17 00:00:00 2001 From: Brett Tofel Date: Tue, 27 Jun 2023 08:58:01 +0200 Subject: [PATCH] Add constants for CCO namespace & deployment --- pkg/operator/constants/constants.go | 6 ++++++ pkg/operator/platform/platform.go | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/operator/constants/constants.go b/pkg/operator/constants/constants.go index bf63e53d4..acbc81ad1 100644 --- a/pkg/operator/constants/constants.go +++ b/pkg/operator/constants/constants.go @@ -130,6 +130,12 @@ const ( // UpgradeableAnnotation is the annotation CCO will check for on the cloudcredential.operator.openshift.io // CR when determining upgradeability. UpgradeableAnnotation = "cloudcredential.openshift.io/upgradeable-to" + + // CCONameSpace Namespace defined for CCO to use + CCONameSpace = "openshift-cloud-credential-operator" + + // DeploymentName name of the CCO deployment + DeploymentName = "cloud-credential-operator" ) var ( diff --git a/pkg/operator/platform/platform.go b/pkg/operator/platform/platform.go index d9144dfef..47f0ab074 100644 --- a/pkg/operator/platform/platform.go +++ b/pkg/operator/platform/platform.go @@ -3,6 +3,7 @@ package platform import ( "context" "fmt" + "github.com/openshift/cloud-credential-operator/pkg/operator/constants" "os" "time" @@ -99,8 +100,8 @@ func GetFeatureGates(ctx context.Context) (featuregates.FeatureGate, error) { eventRecorder := events.NewKubeRecorder(kubeClient.CoreV1().Events("openshift-cloud-credential-operator"), "cloud-credential-operator", &corev1.ObjectReference{ APIVersion: "apps/v1", Kind: "Deployment", - Namespace: "openshift-cloud-credential-operator", - Name: "cloud-credential-operator", + Namespace: constants.CCONameSpace, + Name: constants.DeploymentName, }) // By default, this will exit(0) the process if the featuregates ever change to a different set of values.