-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat(chart)!: manage CRDs as part of release #1671
Conversation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
✅ Deploy Preview for docs-kargo-akuity-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1671 +/- ##
=======================================
Coverage 43.81% 43.81%
=======================================
Files 202 202
Lines 12935 12935
=======================================
Hits 5667 5667
Misses 7026 7026
Partials 242 242 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
{{- if .Values.crds.install -}} | ||
{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }} | ||
{{- $manifest := $.Files.Get $path | fromYaml }} | ||
{{- if $.Values.crds.keep }} | ||
{{- $newAnnotations := dict "helm.sh/resource-policy" "keep" | merge $manifest.metadata.annotations }} | ||
{{- $_ := set $manifest.metadata "annotations" $newAnnotations }} | ||
{{- end }} | ||
{{- $manifest | toYaml }} | ||
{{- print "\n---\n" }} | ||
{{- end }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super slick.
This LGTM and my only thought for a possible improvement is probably better left for a follow-up... we could make your little adoption script available in the project's |
This introduces a new change to the chart which allows the Custom Resource Definitions to be managed as part of the release, effectively allowing upgrades. Which is not possible with Helm's built-in Custom Resource Definition management.
The behavior can be opted-out of by setting
crds.create
tofalse
, causing them to be excluded from the Helm release manifests which effectively causes a fallback to Helm's default behavior.With this change, existing installations will have to adopt the Custom Resource Definitions by configuring the following annotations and label on the resources: