File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,11 +209,14 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
209209build-installer : manifests generate kustomize # # Generate a consolidated YAML with CRDs and deployment.
210210 mkdir -p dist
211211 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
212- @if [ -n " $( VERSION_LABEL) " ]; then \
213- cd config/default && $(KUSTOMIZE ) edit add label app.kubernetes.io/version:$(VERSION_LABEL ) --force; \
214- fi
215- @if [ -n " $( GIT_SHA_LABEL) " ]; then \
216- cd config/default && $(KUSTOMIZE ) edit add label app.kubernetes.io/commit:$(GIT_SHA_LABEL ) --force; \
212+ @if [ -n " $( VERSION_LABEL) " ] || [ -n " $( GIT_SHA_LABEL) " ]; then \
213+ yq write --inplace config/default/kustomization.yaml ' labels[+].includeSelectors' true ; \
214+ if [ -n " $( VERSION_LABEL) " ]; then \
215+ yq write --inplace config/default/kustomization.yaml ' labels[0].pairs[app.kubernetes.io/version]' ' $(VERSION_LABEL)' ; \
216+ fi ; \
217+ if [ -n " $( GIT_SHA_LABEL) " ]; then \
218+ yq write --inplace config/default/kustomization.yaml ' labels[0].pairs[app.kubernetes.io/commit]' ' $(GIT_SHA_LABEL)' ; \
219+ fi ; \
217220 fi
218221 $(KUSTOMIZE ) build config/default > dist/install.yaml
219222 @if [ -n " $( VERSION_LABEL) " ] || [ -n " $( GIT_SHA_LABEL) " ]; then \
You can’t perform that action at this time.
0 commit comments