From dbed281bcc094518b0e58e9c417e0d70126a118e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20St=C3=A4bler?= Date: Wed, 28 Jan 2026 10:19:21 +0100 Subject: [PATCH] Replace deprecated kustomize label command with yq Use yq to add labels in the new format instead of kustomize edit add label, which uses the deprecated commonLabels field. This eliminates deprecation warnings during build-installer execution. --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 38dcb9a..ac6745f 100644 --- a/Makefile +++ b/Makefile @@ -209,11 +209,14 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment. mkdir -p dist cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - @if [ -n "$(VERSION_LABEL)" ]; then \ - cd config/default && $(KUSTOMIZE) edit add label app.kubernetes.io/version:$(VERSION_LABEL) --force; \ - fi - @if [ -n "$(GIT_SHA_LABEL)" ]; then \ - cd config/default && $(KUSTOMIZE) edit add label app.kubernetes.io/commit:$(GIT_SHA_LABEL) --force; \ + @if [ -n "$(VERSION_LABEL)" ] || [ -n "$(GIT_SHA_LABEL)" ]; then \ + yq write --inplace config/default/kustomization.yaml 'labels[+].includeSelectors' true; \ + if [ -n "$(VERSION_LABEL)" ]; then \ + yq write --inplace config/default/kustomization.yaml 'labels[0].pairs[app.kubernetes.io/version]' '$(VERSION_LABEL)'; \ + fi; \ + if [ -n "$(GIT_SHA_LABEL)" ]; then \ + yq write --inplace config/default/kustomization.yaml 'labels[0].pairs[app.kubernetes.io/commit]' '$(GIT_SHA_LABEL)'; \ + fi; \ fi $(KUSTOMIZE) build config/default > dist/install.yaml @if [ -n "$(VERSION_LABEL)" ] || [ -n "$(GIT_SHA_LABEL)" ]; then \