Skip to content

Commit

Permalink
🐛 Fix dublicate labels for Helm chart (#820)
Browse files Browse the repository at this point in the history
Fixes #751

Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker authored Jun 12, 2023
1 parent 2895b19 commit f749ebb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,15 @@ catalog-push: ## Push a catalog image.

HELMIFY = $(LOCALBIN)/helmify
helmify: $(LOCALBIN) ## Download helmify locally if necessary.
GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@v0.3.23
GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@v0.4.3

helm: manifests kustomize helmify
$(KUSTOMIZE) build config/default | $(HELMIFY) $(CHART_NAME)
# The above command creates a helm chart, which has duplicate labels after templating
# We can remove the static doublicate labels here
sed -i -z 's#\(\n[[:blank:]]*selector:\)\n[[:blank:]]*app.kubernetes.io/name: mondoo-operator#\1#' charts/mondoo-operator/templates/metrics-service.yaml
sed -i -z 's#\([[:blank:]]*selector:\n[[:blank:]]*matchLabels:\)\n[[:blank:]]*app.kubernetes.io/name: mondoo-operator#\1#' charts/mondoo-operator/templates/deployment.yaml
sed -i -z 's#\([[:blank:]]*template:\n[[:blank:]]*metadata:\n[[:blank:]]*labels:\)\n[[:blank:]]*app.kubernetes.io/name: mondoo-operator#\1#' charts/mondoo-operator/templates/deployment.yaml

# Install prettier gloablly via
# yarn global add prettier --prefix /usr/local
Expand Down

0 comments on commit f749ebb

Please sign in to comment.