From 053fadeff243c0b14f607ea869253fdd821b5bfa Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Wed, 11 Feb 2026 15:54:26 +0100 Subject: [PATCH] Keep deployment patches in kustomization Retain patch modifications in config/manager/kustomization.yaml instead of removing them after bundle generation. This aligns with the pattern used in the openstack-k8s-operators namespace. The Makefile no longer removes the deployment patch, keeping the kustomization file consistent with the generated bundle. Implements request in this comment [1]. [1] https://github.com/openstack-lightspeed/operator/pull/80#discussion_r2793329012 --- Makefile | 1 - config/manager/kustomization.yaml | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 032e481..ffcb08d 100644 --- a/Makefile +++ b/Makefile @@ -332,7 +332,6 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada cd config/manager && $(KUSTOMIZE) edit add patch --kind Deployment --name controller-manager --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/env/0/value\", \"value\": \"$(OPENSHIFT_LIGHTSPEED_OPERATOR_VERSION)\"}]" $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) $(OPERATOR_SDK) bundle validate ./bundle - cd config/manager && $(KUSTOMIZE) edit remove patch --kind Deployment --name controller-manager --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/env/0/value\", \"value\": \"$(OPENSHIFT_LIGHTSPEED_OPERATOR_VERSION)\"}]" .PHONY: bundle-build bundle-build: ## Build the bundle image. diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5ff6ba4..ebefbe3 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -6,3 +6,9 @@ images: - name: controller newName: quay.io/openstack-lightspeed/operator newTag: latest +patches: +- patch: '[{"op": "replace", "path": "/spec/template/spec/containers/0/env/0/value", + "value": "latest"}]' + target: + kind: Deployment + name: controller-manager