From 66639a0b9d78ec83d43a7d39e62aefee0594d62b Mon Sep 17 00:00:00 2001 From: Bastian Eicher Date: Mon, 8 Jul 2024 21:43:58 +0200 Subject: [PATCH] Avoid generating empty "strategy:" --- charts/generic-service/templates/controller.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/generic-service/templates/controller.yaml b/charts/generic-service/templates/controller.yaml index 01f73e0..15dd991 100644 --- a/charts/generic-service/templates/controller.yaml +++ b/charts/generic-service/templates/controller.yaml @@ -32,7 +32,6 @@ spec: selector: matchLabels: {{- include "generic-service.selector-labels" . | nindent 6 }} - strategy: {{- if eq .Values.rollout.strategy "RollingUpdate" }} {{- if eq .Values.rollout.controller "ArgoRollout" }} {{ fail "rollout.strategy cannot be RollingUpdate if rollout.controller is ArgoRollout, must be Canary or BlueGreen" }} @@ -44,11 +43,13 @@ spec: {{- if eq .Values.rollout.controller "ArgoRollout" }} {{ fail "rollout.strategy cannot be Recreate if rollout.controller is ArgoRollout, must be Canary or BlueGreen" }} {{- end }} + strategy: type: Recreate {{- else if eq .Values.rollout.strategy "OnDelete" }} {{- if and (ne .Values.rollout.controller "StatefulSet") (ne .Values.rollout.controller "DaemonSet") }} {{ fail "rollout.strategy may only be OnDelete if rollout.controller is StatefulSet or DaemonSet" }} {{- end }} + strategy: type: OnDelete {{- else if eq .Values.rollout.strategy "Canary" }} {{- if not .Values.ingress.enabled }} @@ -58,6 +59,7 @@ spec: {{ fail "ingress.domains must not be empty if rollout.strategy is Canary" }} {{- end }} {{- if eq .Values.rollout.controller "ArgoRollout" }} + strategy: canary: stableService: {{ include "generic-service.fullname" . }} stableMetadata: @@ -87,6 +89,7 @@ spec: {{ fail "ingress.enabled must be true if rollout.strategy is BlueGreen" }} {{- end }} {{- if eq .Values.rollout.controller "ArgoRollout" }} + strategy: blueGreen: activeService: {{ include "generic-service.fullname" . }} activeMetadata: