-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(helm): configure version for snapshot api (#361)
On some managed K8s clusters like OpenShift or GKE that ship with their own default CSI Drivers, the controllers will end up creating v1beta1 objects. An issue like the following was noticed when running cstor charts on GKE 1.19. ``` unable to recognize "": no matches for kind "VolumeSnapshotClass" in version "snapshot.storage.k8s.io/v1" ``` This commit uses the helm .Capabilities to check the version available in the cluster and install the class accordingly. As the .Capabilities might return false when using with template command, v1 is kept for false (or default) case. Signed-off-by: kmova <kiran.mova@mayadata.io>
- Loading branch information
Showing
3 changed files
with
7 additions
and
4 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,8 +1,12 @@ | ||
kind: VolumeSnapshotClass | ||
apiVersion: snapshot.storage.k8s.io/v1 | ||
apiVersion: {{ if .Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1beta1" -}} | ||
snapshot.storage.k8s.io/v1beta1 | ||
{{- else -}} | ||
snapshot.storage.k8s.io/v1 | ||
{{- end }} | ||
metadata: | ||
name: csi-cstor-snapshotclass | ||
annotations: | ||
snapshot.storage.kubernetes.io/is-default-class: "true" | ||
driver: cstor.csi.openebs.io | ||
deletionPolicy: Delete | ||
deletionPolicy: Delete |