Skip to content
Permalink
Browse files
Support annotations on volumeClaimTemplates (#23433)
  • Loading branch information
jedcunningham committed May 3, 2022
1 parent 248ae9b commit 5f5ab8017440330cfecd7b49497ba32605780b2b
Showing 8 changed files with 53 additions and 0 deletions.
@@ -100,6 +100,10 @@ spec:
volumeClaimTemplates:
- metadata:
name: redis-db
{{- if .Values.redis.persistence.annotations }}
annotations:
{{- toYaml .Values.redis.persistence.annotations | nindent 10 }}
{{- end }}
spec:
{{- if .Values.redis.persistence.storageClassName }}
storageClassName: {{ .Values.redis.persistence.storageClassName }}
@@ -264,6 +264,10 @@ spec:
volumeClaimTemplates:
- metadata:
name: logs
{{- if .Values.workers.persistence.annotations }}
annotations:
{{- toYaml .Values.workers.persistence.annotations | nindent 10 }}
{{- end }}
spec:
{{- if .Values.workers.persistence.storageClassName }}
storageClassName: {{ .Values.workers.persistence.storageClassName }}
@@ -320,6 +320,10 @@ spec:
volumeClaimTemplates:
- metadata:
name: logs
{{- if .Values.workers.persistence.annotations }}
annotations:
{{- toYaml .Values.workers.persistence.annotations | nindent 10 }}
{{- end }}
spec:
{{- if .Values.workers.persistence.storageClassName }}
storageClassName: {{ .Values.workers.persistence.storageClassName }}
@@ -1266,6 +1266,14 @@
"description": "Execute init container to chown log directory. This is currently only needed in kind, due to usage of local-path provisioner.",
"type": "boolean",
"default": false
},
"annotations": {
"description": "Annotations to add to worker volumes.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
}
}
},
@@ -3781,6 +3789,14 @@
"null"
],
"default": null
},
"annotations": {
"description": "Annotations to add to redis volumes.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
}
}
},
@@ -477,6 +477,8 @@ workers:
# This is currently only needed in kind, due to usage
# of local-path provisioner.
fixPermissions: false
# Annotations to add to worker volumes
annotations: {}

kerberosSidecar:
# Enable kerberos sidecar
@@ -1315,6 +1317,8 @@ redis:
size: 1Gi
# If using a custom storageClass, pass name ref to all statefulSets here
storageClassName:
# Annotations to add to redis volumes
annotations: {}

resources: {}
# limits:
@@ -320,3 +320,10 @@ def test_should_set_correct_helm_hooks_weight(self):
)
annotations = jmespath.search("metadata.annotations", docs[0])
assert annotations["helm.sh/hook-weight"] == "0"

def test_persistence_volume_annotations(self):
docs = render_chart(
values={"redis": {"persistence": {"annotations": {"foo": "bar"}}}},
show_only=["templates/redis/redis-statefulset.yaml"],
)
assert {"foo": "bar"} == jmespath.search("spec.volumeClaimTemplates[0].metadata.annotations", docs[0])
@@ -548,3 +548,10 @@ def test_log_groomer_resources(self):
"memory": "2Gi",
},
} == jmespath.search("spec.template.spec.containers[1].resources", docs[0])

def test_persistence_volume_annotations(self):
docs = render_chart(
values={"executor": "LocalExecutor", "workers": {"persistence": {"annotations": {"foo": "bar"}}}},
show_only=["templates/scheduler/scheduler-deployment.yaml"],
)
assert {"foo": "bar"} == jmespath.search("spec.volumeClaimTemplates[0].metadata.annotations", docs[0])
@@ -547,3 +547,10 @@ def test_log_groomer_resources(self):
"memory": "2Gi",
},
} == jmespath.search("spec.template.spec.containers[1].resources", docs[0])

def test_persistence_volume_annotations(self):
docs = render_chart(
values={"workers": {"persistence": {"annotations": {"foo": "bar"}}}},
show_only=["templates/workers/worker-deployment.yaml"],
)
assert {"foo": "bar"} == jmespath.search("spec.volumeClaimTemplates[0].metadata.annotations", docs[0])

0 comments on commit 5f5ab80

Please sign in to comment.