Skip to content
Open
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ charts: manifests kustomize helm-tool yq dist
mkdir -p $(CHART_DIR)/crds
mkdir -p $(CHART_DIR)/templates
$(YQ) e 'select(.kind == "CustomResourceDefinition")' dist/recommended.yaml > $(CHART_DIR)/crds/all.yaml
$(YQ) e 'select(.kind != "CustomResourceDefinition")' dist/recommended.yaml > $(CHART_DIR)/templates/all.yaml
# Inject 'helm.sh/resource-policy: keep' into doppler-operator-system namespace to prevent it from being destroyed if chart is uninstalled.
# This will also allow future versions of the chart to remove this resource entirely.
$(YQ) e 'select(.kind == "Namespace") | .metadata.annotations."helm.sh/resource-policy" = "keep"' dist/recommended.yaml > $(CHART_DIR)/templates/namespace.yaml
$(YQ) e 'select(.kind != "CustomResourceDefinition" and .kind != "Namespace")' dist/recommended.yaml > $(CHART_DIR)/templates/all.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check/question: With the removal of the Namespace from all.yaml, will we need to do anything else for helm users (new and existing) to pick up the new namespace.yaml file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! The filenames in our helm chart should not matter. Helm will render all of the templates and send the manifests to Kubernetes (where they'll be updated in-place). In my testing, upgrading to this version simply adds the new annotation.

@seslattery, can you confirm my understanding?

cp hack/helm/Chart.yaml $(CHART_DIR)/
cp hack/helm/NOTES.txt $(CHART_DIR)/templates/
touch $(CHART_DIR)/values.yaml
Expand Down