From 7f1ef661bea5539236fd2c2c4c5b70bce3df5da0 Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Mon, 31 Aug 2026 01:13:53 +0530 Subject: [PATCH] fix --- generic-argo-apps-chart/templates/genericTemplate.yaml | 9 +++++++++ values/incubator-infra-k8s-admin-prd-ase1-values.yaml | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/generic-argo-apps-chart/templates/genericTemplate.yaml b/generic-argo-apps-chart/templates/genericTemplate.yaml index 8814ae7..b8b0bc3 100644 --- a/generic-argo-apps-chart/templates/genericTemplate.yaml +++ b/generic-argo-apps-chart/templates/genericTemplate.yaml @@ -54,4 +54,13 @@ spec: syncPolicy: syncOptions: - CreateNamespace=true +{{- if $config.serverSideApply }} + # Opt-in per appSpec entry. Needed when adopting a resource that was + # created outside Argo and has fields the new manifest changes type + # on (e.g. an env var moving from `value` to `valueFrom`) — a plain + # strategic-merge patch can add the new field without clearing the + # old one, which the API rejects. SSA transfers field ownership + # correctly instead. + - ServerSideApply=true +{{- end }} {{- end }} diff --git a/values/incubator-infra-k8s-admin-prd-ase1-values.yaml b/values/incubator-infra-k8s-admin-prd-ase1-values.yaml index bb1cbf8..00420a1 100644 --- a/values/incubator-infra-k8s-admin-prd-ase1-values.yaml +++ b/values/incubator-infra-k8s-admin-prd-ase1-values.yaml @@ -41,4 +41,11 @@ appSpec: nameOverride: gitea namespace: gitea chartDir: gitea - valuesDir: gitea \ No newline at end of file + valuesDir: gitea + # Adoption-only: the live init container still has plaintext `value` + # fields for GITEA_ADMIN_USERNAME/PASSWORD from the original imperative + # install; our values switch those to `valueFrom: secretKeyRef`. A + # normal patch can't clear the old field while adding the new one — + # see the note in generic-argo-apps-chart's template. Safe to remove + # once the live object no longer carries the old `value` fields. + serverSideApply: true \ No newline at end of file