-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: crds getting removed on helm upgrades (#519)
* fix: crds getting removed on helm upgrades Signed-off-by: Abhinandan Purkait <[email protected]> * chore: add condition for the crds subchart Signed-off-by: Abhinandan Purkait <[email protected]> * feat(chart): update README Signed-off-by: Abhinandan Purkait <[email protected]> --------- Signed-off-by: Abhinandan Purkait <[email protected]>
- Loading branch information
1 parent
d99b0a0
commit 6d3d2ce
Showing
14 changed files
with
32 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
apiVersion: v2 | ||
name: crds | ||
version: 2.5.0 | ||
version: 2.5.1 | ||
description: A Helm chart that collects CustomResourceDefinitions (CRDs) from zfs-localpv. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{/* | ||
This returns a "1" if the CRD is absent in the cluster | ||
Adds extra annotations to CRDs. This targets two scenarios: preventing CRD recycling in case | ||
the chart is removed; and adding custom annotations. | ||
NOTE: This function assumes the element `metadata.annotations` already exists. | ||
Usage: | ||
{{- if (include "crdIsAbsent" (list <crd-name>)) -}} | ||
# CRD Yaml | ||
{{- end -}} | ||
{{- include "crds.extraAnnotations" .Values.csi.volumeSnapshots | nindent 4 }} | ||
*/}} | ||
{{- define "crdIsAbsent" -}} | ||
{{- $crdName := index . 0 -}} | ||
{{- $crd := lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" $crdName -}} | ||
{{- $output := "1" -}} | ||
{{- if $crd -}} | ||
{{- $output = "" -}} | ||
{{- end -}} | ||
|
||
{{- $output -}} | ||
{{- define "crds.extraAnnotations" -}} | ||
{{- if .keep -}} | ||
helm.sh/resource-policy: keep | ||
{{ end }} | ||
{{- with .annotations }} | ||
{{- toYaml . }} | ||
{{- end }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
zfsLocalPv: | ||
# Install zfs-localpv CRDs | ||
enabled: true | ||
# -- Keep CRDs on chart uninstall | ||
keep: true | ||
|
||
csi: | ||
volumeSnapshots: | ||
# Install Volume Snapshot CRDs | ||
enabled: true | ||
# -- Keep CRDs on chart uninstall | ||
keep: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters