From fe8961dcbb83ba54e7562cece0f1d33e71fda952 Mon Sep 17 00:00:00 2001 From: Anasawara Suresh M K <116827111+Anaswara-Suresh@users.noreply.github.com> Date: Wed, 8 Jul 2026 13:51:14 +0530 Subject: [PATCH] fix: preserve existing caBundle during upgrade of cluster-gateway APIService (#7220) Signed-off-by: Anaswara Suresh --- .../templates/cluster-gateway/cluster-gateway.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/vela-core/templates/cluster-gateway/cluster-gateway.yaml b/charts/vela-core/templates/cluster-gateway/cluster-gateway.yaml index 99d2cc328..e9836baa3 100644 --- a/charts/vela-core/templates/cluster-gateway/cluster-gateway.yaml +++ b/charts/vela-core/templates/cluster-gateway/cluster-gateway.yaml @@ -162,9 +162,18 @@ spec: versionPriority: 10 insecureSkipTLSVerify: {{ not .Values.multicluster.clusterGateway.secureTLS.enabled }} {{ if .Values.multicluster.clusterGateway.secureTLS.enabled }} - caBundle: Cg== + {{- /* Preserve an already-valid caBundle on upgrade so we don't reset it to the + Cg== placeholder before the patch Job re-runs + $apiSvc is the existing APIService looked up above; fall back to the + placeholder only on fresh install or when it still holds the placeholder. */}} + {{- $caBundle := "Cg==" }} + {{- if and $apiSvc $apiSvc.spec (hasKey $apiSvc.spec "caBundle") (ne $apiSvc.spec.caBundle "Cg==") }} + {{- $caBundle = $apiSvc.spec.caBundle }} + {{- end }} + caBundle: {{ $caBundle }} {{ end }} {{ end }} + --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole