Support for PVC annotations (#51)
This commit is contained in:
@@ -8,6 +8,10 @@ kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ printf "%s-%s" $robustName .name }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
{{- if .pvcAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml .pvcAnnotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .accessMode | default "ReadWriteOnce" }}
|
||||
|
||||
@@ -13,6 +13,20 @@ tests:
|
||||
- equal:
|
||||
path: spec.storageClassName
|
||||
value: default
|
||||
- it: Should assign annotations to the PVC
|
||||
set:
|
||||
volumes:
|
||||
- name: data
|
||||
path: /var/lib/1clickinfra/data
|
||||
size: 10Gi
|
||||
storageClass: default
|
||||
pvcAnnotations:
|
||||
rancher.io/local-path/volume-type: local
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
rancher.io/local-path/volume-type: local
|
||||
- it: Should not generate a claim when using existing claim
|
||||
set:
|
||||
volumes:
|
||||
|
||||
@@ -719,6 +719,18 @@
|
||||
"type": "string",
|
||||
"title": "Storage Class",
|
||||
"description": "The slug indicating the disk type in your cloud provider. `standard` on Google Cloud, `default` on Azure; `do-block-storage` on Digital Ocean"
|
||||
},
|
||||
"pvcAnnotations": {
|
||||
"type": "object",
|
||||
"title": "Annotations",
|
||||
"description": "Annotations are used to control the persistance claim behavior.",
|
||||
"default": {},
|
||||
"examples": [
|
||||
{
|
||||
"rancher.io/local-path/volume-type": "local"
|
||||
}
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
Reference in New Issue
Block a user