Support for PVC annotations (#51)
This commit is contained in:
@@ -8,6 +8,10 @@ kind: PersistentVolumeClaim
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ printf "%s-%s" $robustName .name }}
|
name: {{ printf "%s-%s" $robustName .name }}
|
||||||
namespace: {{ $.Release.Namespace }}
|
namespace: {{ $.Release.Namespace }}
|
||||||
|
{{- if .pvcAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml .pvcAnnotations | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- {{ .accessMode | default "ReadWriteOnce" }}
|
- {{ .accessMode | default "ReadWriteOnce" }}
|
||||||
|
|||||||
@@ -13,6 +13,20 @@ tests:
|
|||||||
- equal:
|
- equal:
|
||||||
path: spec.storageClassName
|
path: spec.storageClassName
|
||||||
value: default
|
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
|
- it: Should not generate a claim when using existing claim
|
||||||
set:
|
set:
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -719,6 +719,18 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "Storage Class",
|
"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"
|
"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": [
|
"required": [
|
||||||
|
|||||||
+1
-1
@@ -15,4 +15,4 @@ volumes:
|
|||||||
path: /deleteme
|
path: /deleteme
|
||||||
- name: empty
|
- name: empty
|
||||||
path: /deleteme2
|
path: /deleteme2
|
||||||
emptyDir: true
|
emptyDir: true
|
||||||
Reference in New Issue
Block a user