From efa56271bd8a2b5c24547238d25c52f092537dda Mon Sep 17 00:00:00 2001 From: Eguzki Astiz Lezaun Date: Wed, 20 Dec 2023 00:48:06 +0100 Subject: [PATCH 1/3] fix cluster scoped istio CR --- config/dependencies/istio/sail/istio.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/dependencies/istio/sail/istio.yaml b/config/dependencies/istio/sail/istio.yaml index c8abff12b..afe4b4480 100644 --- a/config/dependencies/istio/sail/istio.yaml +++ b/config/dependencies/istio/sail/istio.yaml @@ -1,8 +1,7 @@ apiVersion: operator.istio.io/v1alpha1 kind: Istio metadata: - name: istiocontrolplane - namespace: istio-system + name: default spec: version: v1.20.0 namespace: istio-system From 1e67517bdecad1315f12d6098030de4352ce9afe Mon Sep 17 00:00:00 2001 From: Eguzki Astiz Lezaun Date: Wed, 20 Dec 2023 17:27:00 +0100 Subject: [PATCH 2/3] custom name for the sail operator's istio CR --- controllers/kuadrant_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/kuadrant_controller.go b/controllers/kuadrant_controller.go index da47991bd..af03531c8 100644 --- a/controllers/kuadrant_controller.go +++ b/controllers/kuadrant_controller.go @@ -332,6 +332,7 @@ func (r *KuadrantReconciler) getIstioConfigObjects(ctx context.Context, logger l } else { // Error is NoMatchError so check for Istio CR instead ist := &istiov1alpha1.Istio{} + istKey := client.ObjectKey{Name: istioCRName()} if err := r.GetResource(ctx, istKey, ist); err != nil { logger.V(1).Info("failed to get istio object", "key", istKey, "err", err) if apimeta.IsNoMatchError(err) { @@ -380,6 +381,10 @@ func controlPlaneProviderName() string { return env.GetString("ISTIOOPERATOR_NAME", "istiocontrolplane") } +func istioCRName() string { + return env.GetString("ISTIO_NAME", "default") +} + func controlPlaneConfigMapName() string { return env.GetString("ISTIOCONFIGMAP_NAME", "istio") } From 86e10d9dffc18dc0a4a23590a7042f8ca3dab20e Mon Sep 17 00:00:00 2001 From: Adam Cattermole Date: Mon, 8 Jan 2024 15:25:49 +0000 Subject: [PATCH 3/3] Istio CR must be named default --- controllers/kuadrant_controller.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/controllers/kuadrant_controller.go b/controllers/kuadrant_controller.go index af03531c8..b43adcdc0 100644 --- a/controllers/kuadrant_controller.go +++ b/controllers/kuadrant_controller.go @@ -50,6 +50,8 @@ import ( const ( kuadrantFinalizer = "kuadrant.io/finalizer" + // (Sail) The istio CR must be named default to process GW API resources + istioCRName = "default" ) // KuadrantReconciler reconciles a Kuadrant object @@ -332,7 +334,7 @@ func (r *KuadrantReconciler) getIstioConfigObjects(ctx context.Context, logger l } else { // Error is NoMatchError so check for Istio CR instead ist := &istiov1alpha1.Istio{} - istKey := client.ObjectKey{Name: istioCRName()} + istKey := client.ObjectKey{Name: istioCRName} if err := r.GetResource(ctx, istKey, ist); err != nil { logger.V(1).Info("failed to get istio object", "key", istKey, "err", err) if apimeta.IsNoMatchError(err) { @@ -381,10 +383,6 @@ func controlPlaneProviderName() string { return env.GetString("ISTIOOPERATOR_NAME", "istiocontrolplane") } -func istioCRName() string { - return env.GetString("ISTIO_NAME", "default") -} - func controlPlaneConfigMapName() string { return env.GetString("ISTIOCONFIGMAP_NAME", "istio") }