Ignoring sub directories

26 views
Skip to first unread message

Warren Strange

unread,
Apr 13, 2020, 6:57:25 PM4/13/20
to kpt-users

We have some legacy helm charts with templates in our git repo. They are in a sub directory.  

When I try to create or set a setter, kpt errors out trying to parse one of the helm chart yaml's (which of course is not valid yaml due to Go templating - the joys of Helm, sigh...)

I thought I'd stick a skeleton Kptfile in that directory to see if that would short circuit kpt going into that directory - but it doesn't seem to work.

Any suggestions? 

I gather that any yaml file in git must be valid yaml? (no templating..)

Phillip Wittrock

unread,
Apr 13, 2020, 7:10:51 PM4/13/20
to Warren Strange, kpt-users
Yes, any *.yaml files must parse as valid yaml.  Though I haven't tried it, I suspect tools such as ytt would work with kpt as the templating is performed as comments and the yaml is still parseable.

The low-level libraries do support matching based on globs: https://github.com/kubernetes-sigs/kustomize/blob/master/kyaml/kio/pkgio_reader.go#L53
It would probably be possible to add a 'glob' field to the Kptfile and wire it into the directory reader / writer library invocations.  We could probably also add a blacklist glob to ignore files as well.

- Phil


--
You received this message because you are subscribed to the Google Groups "kpt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kpt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kpt-users/715e11dc-52b4-49e3-8306-758404b14a12%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages