Deployment strategy is configurable; still having the single replica volume rule
This commit is contained in:
@@ -15,10 +15,15 @@ spec:
|
||||
matchLabels:
|
||||
{{- include "helm-chart.selectorLabels" . | nindent 6 }}
|
||||
{{- $singleReplica := eq (.Values.replicas | int64) 1 }}
|
||||
{{- if and .Values.volumes $singleReplica }}
|
||||
{{- $strategyNotDefined := not .Values.strategy }}
|
||||
{{- if and (and .Values.volumes $singleReplica) $strategyNotDefined}}
|
||||
strategy:
|
||||
type: Recreate
|
||||
{{- end }}
|
||||
{{- if .Values.strategy }}
|
||||
strategy:
|
||||
type: {{ .Values.strategy }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
|
||||
@@ -42,3 +42,22 @@ tests:
|
||||
- equal:
|
||||
path: spec.strategy.type
|
||||
value: Recreate
|
||||
- it: Should strategy take precedence
|
||||
set:
|
||||
volumes:
|
||||
- name: data
|
||||
path: /var/lib/1clickinfra/data
|
||||
size: 10Gi
|
||||
storageClass: default
|
||||
strategy: RollingUpdate
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.strategy.type
|
||||
value: RollingUpdate
|
||||
- it: Should strategy be set
|
||||
set:
|
||||
strategy: Dummy
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.strategy.type
|
||||
value: Dummy
|
||||
Reference in New Issue
Block a user