-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Request for looser checking of builder names in provisioner only/except/override clauses #2651
Comments
Thanks for opening a ticket. Does this work if you use I think in the |
No, using -only makes no difference. As an example of what I'd like to achieve is to have one builder produce one of four combinations (ie 2 variables with 2 possible values each) of images without having to duplicate the builder four times. A cut down example:
An example error output:
Using -only still fails the same way when parsing the template because the provisioners are referencing builder names that don't exist. What I'm hoping for is that the provisioners only clauses get evaluated later after the builder name is interpolated, and the provisioners decide to run if the builder name matches just one of them even if some of the other builder names don't actually exist during this run. except would work the same way, just that it wouldn't run if one of the builder names matched. Hopefully that makes a bit more sense. The alternatives seem to be lots of template duplication or maybe generating the templates on the fly with a script of some sort. |
It's a shame this isn't fixed! I'd hoped to avoid having multiple identical builders by setting the builder name from a user variable - but it sounds like this blocks that use case. 😞 |
A fix for this issue would be very useful. +1 |
+1 to get this going as well (A useful feature to have and would save us the ability of recreating a duplicate file.) |
+1 |
+1 - would be extremely useful too. |
I'm sorry that this hasn't been prioritized, but PRs are always welcome! |
Could we also allow the only and except texts to be interpolated/templated?
So this would limit the provisioner to all versions of yesfoo. |
I'm doing some issue cleanup; this is basically a duplicate of #4895 which I think is a bit broader in scope, so even though this issue predates that I'm going to close this as a duplicate of that one. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When I use a builder name that is interpolated at runtime (ie containing user variables) I can't match the various name combinations in provisioners.
Provisioner matching using the actual runtime builder name fails at template validation/parsing time because there is no builder defined in the template that matches the names in the provisioners.
Would it be possible to change those failures to warnings? That way a single builder could make several different types of images based on which provisioners it matches.
This seems similar to #858 but I think that issue only fixed matching interpolated builder names from the CLI rather than in the provisioners.
The text was updated successfully, but these errors were encountered: