Skip to content

Commit

Permalink
fix(t8s-cluster/management-cluster): replace remove with add `rem…
Browse files Browse the repository at this point in the history
…ove` doesn't work when the `path` doesn't exist 🤦 (#1088)
  • Loading branch information
cwrau authored Aug 9, 2024
1 parent 987eda1 commit 850e3fd
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down

0 comments on commit 850e3fd

Please sign in to comment.