Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of kustomize transformers with "path" instead of "patch" #90

Open
gllb opened this issue Jul 10, 2024 · 1 comment
Open

Usage of kustomize transformers with "path" instead of "patch" #90

gllb opened this issue Jul 10, 2024 · 1 comment

Comments

@gllb
Copy link
Contributor

gllb commented Jul 10, 2024

Hello,

I have a need for a transformer that patch a complex yaml configuration (nodeSelector) in multiple template of a chart. So I figure a kustomize transformer might solve this (https://kubectl.docs.kubernetes.io/references/kustomize/builtins/#_patchtransformer_) and more specifically I need to use the path instead of the patch because the former one only allow a string, which is not compatible with nodeSelector.

But its like chartify does not support this path usage in transformers because I get either :
if using a relative path:

  Error: accumulation err='accumulating resources from 'transformers/transformer.0.yaml': missing Resource metadata': must build at directory: '/tmp/chartify3396108642/....../transformers/transformer.0.yaml': file is not directory]

or if using an absolute path:

  Error: plugin PatchTransformer.builtin.[noGrp]/not-important.[noNs] fails configuration: failed to get the patch file from path(/.../nodeSelector.yaml): security; file '/.../nodeSelector.yaml' is not in or below '/tmp/chartify336424650/.../']

So question here : Do I misuse the transformer object, or is there a better approach ? Does chartify lack the support for the path by not copying the file in the temporary dir ?

I'm happy if you guys have some better approach for this problem, as I found kustomize somehow complex to use.

@yxxhero
Copy link
Member

yxxhero commented Aug 28, 2024

@gllb PR is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants