Deployment strategy is configurable; still having the single replica volume rule
This commit is contained in:
@@ -15,10 +15,15 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "helm-chart.selectorLabels" . | nindent 6 }}
|
{{- include "helm-chart.selectorLabels" . | nindent 6 }}
|
||||||
{{- $singleReplica := eq (.Values.replicas | int64) 1 }}
|
{{- $singleReplica := eq (.Values.replicas | int64) 1 }}
|
||||||
{{- if and .Values.volumes $singleReplica }}
|
{{- $strategyNotDefined := not .Values.strategy }}
|
||||||
|
{{- if and (and .Values.volumes $singleReplica) $strategyNotDefined}}
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.strategy }}
|
||||||
|
strategy:
|
||||||
|
type: {{ .Values.strategy }}
|
||||||
|
{{- end }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
@@ -42,3 +42,22 @@ tests:
|
|||||||
- equal:
|
- equal:
|
||||||
path: spec.strategy.type
|
path: spec.strategy.type
|
||||||
value: Recreate
|
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