From 921997174cf7a7e99b7d7c86d858760412de60e6 Mon Sep 17 00:00:00 2001 From: Kha Do Date: Thu, 21 Aug 2025 17:50:14 -0400 Subject: [PATCH] Set servicemesh operator catalog for OKD --- pkg/operator/controller/gatewayclass/okd.go | 7 +++++++ .../controller/gatewayclass/subscription.go | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 pkg/operator/controller/gatewayclass/okd.go diff --git a/pkg/operator/controller/gatewayclass/okd.go b/pkg/operator/controller/gatewayclass/okd.go new file mode 100644 index 0000000000..5042f2408d --- /dev/null +++ b/pkg/operator/controller/gatewayclass/okd.go @@ -0,0 +1,7 @@ +//go:build okd + +package gatewayclass + +func init() { + OKD = true +} diff --git a/pkg/operator/controller/gatewayclass/subscription.go b/pkg/operator/controller/gatewayclass/subscription.go index a37388fa4d..55192d153c 100644 --- a/pkg/operator/controller/gatewayclass/subscription.go +++ b/pkg/operator/controller/gatewayclass/subscription.go @@ -16,6 +16,10 @@ import ( "k8s.io/apimachinery/pkg/types" ) +var ( + OKD = false +) + // ensureServiceMeshOperatorSubscription attempts to ensure that a subscription // for servicemeshoperator is present and returns a Boolean indicating whether // it exists, the subscription if it exists, and an error value. @@ -49,6 +53,13 @@ func (r *reconciler) ensureServiceMeshOperatorSubscription(ctx context.Context) // desiredSubscription returns the desired subscription. func desiredSubscription(name types.NamespacedName) (*operatorsv1alpha1.Subscription, error) { + packageName := "servicemeshoperator" + catalogSource := "redhat-operators" + + if OKD { + packageName = "servicemeshoperator3" + catalogSource = "okderators" + } subscription := operatorsv1alpha1.Subscription{ ObjectMeta: metav1.ObjectMeta{ Namespace: name.Namespace, @@ -57,8 +68,8 @@ func desiredSubscription(name types.NamespacedName) (*operatorsv1alpha1.Subscrip Spec: &operatorsv1alpha1.SubscriptionSpec{ Channel: "stable", InstallPlanApproval: operatorsv1alpha1.ApprovalAutomatic, - Package: "servicemeshoperator", - CatalogSource: "redhat-operators", + Package: packageName, + CatalogSource: catalogSource, CatalogSourceNamespace: "openshift-marketplace", }, }