tazjin/kontemplate

Allow "path" to point at specific files

Closed this issue · 6 comments

This won't make it into today's release, needs some more fleshing out.

This relates to #76 and #69

Really looking forward to this – this is the one feature that blocks me from switching from ktmpl to this project. I'm not sure how your rewrite in Rust is going but if there is anything I can do to help get this done please let me know.

Hey!

The rewrite stagnated a bit because I've had some personal issues to deal with over the last month. There are so many things in the backlog here now that I'll probably end up doing another Go-release.

There are a few open questions for this particular feature and your input would be welcome:

  1. If path is unset and no folder exists, should kontemplate attempt to find a $name.yml/yaml/json file anyways?

  2. If yes, what happens if both a $name folder and $name.yaml were to exist?

  3. When using the path parameter, do you think this is an acceptable implementation:

include:
  - name: some-service
    path: stuff/some-service.yaml
    values: [ ... ] 
  1. I don't think $name.yml/yaml/json makes sense. If there is a name but no path, stick to the current default

  2. I see two options, both are fit my use case well enough: a) if a path is unspecified, use a folder by default (only use a file if path is explicitly set and a regular file); or b) if a path is unspecified, use a folder by default, and a file named $name.yml only if the folder does not exist

  3. Sure!

luarx commented

I agree with @rolftimmermans but I would answer:

  1. I don't think $name.yml/yaml/json makes sense. If there is a name but no path, stick to the current default
  2. It won't happen because the previous answer is no :)
  3. Yes!

And if a path is specified, it must have a file extension attached. It would be necessary to difference between folder and file.

This functionality is useful because I have a file for each deployment, service, hpa and configmap in the same resource set. For this reason, some times I want to update only a specific file and I don't want to create a folder for each kuberentes file...

Change is included in version 1.6.0!

luarx commented

Thank you very much @tazjin!!! It is a very useful feature :D