Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix duplicate labels for Helm chart #820

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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