From e26bce89ca416c78ffb444977d8cdff81284f1a5 Mon Sep 17 00:00:00 2001 From: David Simansky Date: Wed, 7 May 2025 12:28:24 +0200 Subject: [PATCH] Add a specific order to operator install stage --- .../hack/005-operator-install-order.patch | 19 +++++++++++++++++++ .../operator/pkg/reconciler/common/install.go | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 olm-catalog/serverless-operator/hack/005-operator-install-order.patch diff --git a/olm-catalog/serverless-operator/hack/005-operator-install-order.patch b/olm-catalog/serverless-operator/hack/005-operator-install-order.patch new file mode 100644 index 0000000000..6eaec152a5 --- /dev/null +++ b/olm-catalog/serverless-operator/hack/005-operator-install-order.patch @@ -0,0 +1,19 @@ +diff --git a/vendor/knative.dev/operator/pkg/reconciler/common/install.go b/vendor/knative.dev/operator/pkg/reconciler/common/install.go +index 83170d87c..e5a679c62 100644 +--- a/vendor/knative.dev/operator/pkg/reconciler/common/install.go ++++ b/vendor/knative.dev/operator/pkg/reconciler/common/install.go +@@ -55,6 +55,14 @@ func Install(ctx context.Context, manifest *mf.Manifest, instance base.KComponen + status.MarkInstallFailed(err.Error()) + return fmt.Errorf("failed to apply (cluster)rolebindings: %w", err) + } ++ if err := manifest.Filter(mf.Any(mf.ByKind("ConfigMap"))).Apply(); err != nil { ++ status.MarkInstallFailed(err.Error()) ++ return fmt.Errorf("failed to apply configmaps: %w", err) ++ } ++ if err := manifest.Filter(mf.Any(mf.ByKind("Deployment"))).Apply(); err != nil { ++ status.MarkInstallFailed(err.Error()) ++ return fmt.Errorf("failed to apply deployments: %w", err) ++ } + if err := manifest.Filter(mf.Not(mf.Any(role, rolebinding, webhook, webhookDependentResources))).Apply(); err != nil { + status.MarkInstallFailed(err.Error()) + if ks, ok := instance.(*v1beta1.KnativeServing); ok && strings.Contains(err.Error(), gatewayNotMatch) && diff --git a/vendor/knative.dev/operator/pkg/reconciler/common/install.go b/vendor/knative.dev/operator/pkg/reconciler/common/install.go index 83170d87cd..e5a679c625 100644 --- a/vendor/knative.dev/operator/pkg/reconciler/common/install.go +++ b/vendor/knative.dev/operator/pkg/reconciler/common/install.go @@ -55,6 +55,14 @@ func Install(ctx context.Context, manifest *mf.Manifest, instance base.KComponen status.MarkInstallFailed(err.Error()) return fmt.Errorf("failed to apply (cluster)rolebindings: %w", err) } + if err := manifest.Filter(mf.Any(mf.ByKind("ConfigMap"))).Apply(); err != nil { + status.MarkInstallFailed(err.Error()) + return fmt.Errorf("failed to apply configmaps: %w", err) + } + if err := manifest.Filter(mf.Any(mf.ByKind("Deployment"))).Apply(); err != nil { + status.MarkInstallFailed(err.Error()) + return fmt.Errorf("failed to apply deployments: %w", err) + } if err := manifest.Filter(mf.Not(mf.Any(role, rolebinding, webhook, webhookDependentResources))).Apply(); err != nil { status.MarkInstallFailed(err.Error()) if ks, ok := instance.(*v1beta1.KnativeServing); ok && strings.Contains(err.Error(), gatewayNotMatch) &&