-
Notifications
You must be signed in to change notification settings - Fork 558
Description
With #673 helmfile gained support for applying patches via kustomize. The helmfile directives jsonPatches and strategicMergePatches are translated to patchesJson6902 and strategicmergepatches in the generated kustomization.yaml by https://github.com/variantdev/chartify.
Unfortunately both of these directives don't support patching multiple Kubernetes resources at once. This is only supported by kustomize's patches directive (see https://kubernetes-sigs.github.io/kustomize/api-reference/kustomization/patches/) which in turn both supports strategic merge patches and a JSON patches. kustomize's patches directive accepts partial target specifications, target specification containing regular expressions and even label and annotation selectors.
My use case: I want to add some annotations to all resources of a Helm chart which doesn't support doing so via values.yaml.
Proposal: Add this kustomize feature via a new Helmfile directive patches which gets translated to the directive of the same name in the kustomization.yaml. The code should be identical to the one already present for the jsonPatches directive I think. See: https://github.com/variantdev/chartify/blob/d5b0a294ed25506d900c6fe7024a60a557f1c977/patch.go#L47-L109.