Skip to content

Commit

Permalink
feat: Add persistentVolumeClaimRetentionPolicy to sts
Browse files Browse the repository at this point in the history
  • Loading branch information
bjw-s committed Jul 29, 2024
1 parent a9c5925 commit 2f6276b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/library/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ annotations:
- kind: added
description: |-
Added `stdin` and `tty` fields to container spec.
- kind: added
description: |-
Added `persistentVolumeClaimRetentionPolicy` field to statefulset spec.
- kind: fixed
description: |-
Added `externalName` field to service schema.
16 changes: 16 additions & 0 deletions charts/library/common/schemas/controllers.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@
"podManagementPolicy": {
"type": "string"
},
"persistentVolumeClaimRetentionPolicy": {
"type": "object",
"additionalProperties": false,
"properties": {
"whenDeleted": {
"type": "string",
"enum": ["Delete", "Retain"],
"default": "Retain"
},
"whenScaled": {
"type": "string",
"enum": ["Delete", "Retain"],
"default": "Retain"
}
}
},
"volumeClaimTemplates": {
"type": "array",
"items": {
Expand Down
3 changes: 3 additions & 0 deletions charts/library/common/templates/classes/_statefulset.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
app.kubernetes.io/component: {{ $statefulsetObject.identifier }}
{{- include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | nindent 6 }}
serviceName: {{ include "bjw-s.common.lib.chart.names.fullname" $rootContext }}
{{- with (dig "statefulset" "persistentVolumeClaimRetentionPolicy" nil $statefulsetObject) }}
persistentVolumeClaimRetentionPolicy: {{ . | nindent 4 }}
{{- end -}}
template:
metadata:
{{- with (include "bjw-s.common.lib.pod.metadata.annotations" (dict "rootContext" $rootContext "controllerObject" $statefulsetObject)) }}
Expand Down

0 comments on commit 2f6276b

Please sign in to comment.