From 850e3fdcb17a1c0e6b8f1765825140f69b11f90d Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Fri, 9 Aug 2024 18:11:05 +0200 Subject: [PATCH] =?UTF-8?q?fix(t8s-cluster/management-cluster):=20replace?= =?UTF-8?q?=20`remove`=20with=20`add`=20`remove`=20doesn't=20work=20when?= =?UTF-8?q?=20the=20`path`=20doesn't=20exist=20=F0=9F=A4=A6=20(#1088)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clusterClass/patches/_kubelet.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl b/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl index 944ebeb09..f2849f0cd 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl @@ -28,12 +28,12 @@ {{- $values = set $values "featureGates" (include "t8s-cluster.kubelet.featureGates" (dict) | fromYaml) -}} {{- $patches := list -}} {{/* clear the old stuff beforehand, otherwise they just stay there 😐 */}} - {{- $deleteJsonPatch := list -}} - {{- $settingsToDelete := list "/featureGates" -}} - {{- range $settingToDelete := $settingsToDelete -}} - {{- $deleteJsonPatch = append $deleteJsonPatch (dict "op" "remove" "path" $settingToDelete) -}} + {{- $cleanupJsonPatch := list -}} + {{- $settingsToClean := dict "/featureGates" (dict) -}} + {{- range $settingToClean, $cleanValue := $settingsToClean -}} + {{- $cleanupJsonPatch = append $cleanupJsonPatch (dict "op" "add" "path" $settingToClean "value" $cleanValue) -}} {{- end -}} - {{- $patches = append $patches (include "t8s-cluster.patches.patchFile" (dict "values" $deleteJsonPatch "target" "kubeletconfiguration" "suffix" 0 "patchType" "json") | fromYaml) -}} + {{- $patches = append $patches (include "t8s-cluster.patches.patchFile" (dict "values" $cleanupJsonPatch "target" "kubeletconfiguration" "suffix" 0 "patchType" "json") | fromYaml) -}} {{- $patches = append $patches (include "t8s-cluster.patches.patchFile" (dict "values" $values "target" "kubeletconfiguration" "component" "default") | fromYaml) -}} {{- $patches | toYaml -}} {{- end -}}