-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ability to render just an entry point template #80
Comments
Existing functionality already allows to place templates into directories. So that example above would work without Example:
|
The idea is to let k8t templates devs to decide how to customize cluster during overriding. It's possible to handle the problem with guard values but it'll create more complexity. E.g. you can't be sure that you disable the concrete template because guard can be reused in several templates. Another problem is macroses. It would be nice to have them shared. But if just add something like Manifest ( @sl4vr I don't propose to switch to this behaviour completely, we can just add with feature and if it's not needed then users can just use old behaviour |
Afaik it's intended to do so since root templates are supposed to be present in all clusters and environments
But yup, guard values can be used when you want to render something everywhere but in some particular cases. It's pretty handy with current
I would love to make
Probably the only reason I'm reluctant to that is that it won't be clear from file structure anymore what is used and what's not. Anyway I don't say it's bad idea, probably that's a better way to use k8t. Anyway I just wanted to pointed out existing way to organise templates (as I thought that's what you've been looking for), but what's up to this feature it's better address to @AFriemann. |
Maybe I see it from devs perspective :) Jinja is very powerful and I was excited to use it's features, especially macroses and imports for code reuse. Now after your comments I think that maybe the proposed feature will bring some unnecessary complexity 🤔 |
theoretically this is now possible via the does that solve your issue @autouser ? |
a possible solution would be to restrict the templates in a normal run to only the entrypoint - I don't think that would be difficult to add tbh. |
Nice 👍 Yes, I think it solves the issue. Instead of single manifest file we can you a bash script. |
For better templates organization and flexibility I propose to add a possibility to render just one entry point.
Currently we render all templates in alphabetical order. We can add an argument to
gen
command to specify just one template to renderk8t gen [...] --entry=main
and letjinja2
to manage dependencies throughinclude
andimport
.Example:
The text was updated successfully, but these errors were encountered: