From 3332f4c862faf5efdd43ab19eace258eea1a94f4 Mon Sep 17 00:00:00 2001 From: nicholasmhughes Date: Thu, 18 Feb 2021 20:41:55 -0500 Subject: [PATCH] closes kubernetes-sigs/aws-ebs-csi-driver#733; add storage class annotation and label handling to chart --- charts/aws-ebs-csi-driver/templates/storageclass.yaml | 8 +++++++- charts/aws-ebs-csi-driver/values.yaml | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/templates/storageclass.yaml b/charts/aws-ebs-csi-driver/templates/storageclass.yaml index c69af7dc63..3f9db8ad0e 100644 --- a/charts/aws-ebs-csi-driver/templates/storageclass.yaml +++ b/charts/aws-ebs-csi-driver/templates/storageclass.yaml @@ -3,6 +3,12 @@ kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: {{ .name }} + {{- if .annotations }} + annotations: {{- .annotations | toYaml | trim | nindent 4 }} + {{- end }} + {{- if .labels }} + labels: {{- .labels | toYaml | trim | nindent 4 }} + {{- end }} provisioner: ebs.csi.aws.com -{{ omit (dict "volumeBindingMode" "WaitForFirstConsumer" | merge .) "name" | toYaml }} +{{ omit (dict "volumeBindingMode" "WaitForFirstConsumer" | merge .) "name" "annotations" "labels" | toYaml }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 732e2db6d1..3cad7a1c38 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -114,6 +114,12 @@ serviceAccount: storageClasses: [] # Add StorageClass resources like: # - name: ebs-sc +# # annotation metadata +# annotations: +# storageclass.kubernetes.io/is-default-class: "true" +# # label metadata +# labels: +# my-label-is: supercool # # defaults to WaitForFirstConsumer # volumeBindingMode: WaitForFirstConsumer # # defaults to Delete