-
Notifications
You must be signed in to change notification settings - Fork 273
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
Optional template variables seem to be broken since 0.12.13 #2241
Comments
Thanks for the detailed report @tvollstaedt. I'm gonna take a quick look. One quick thing to validate this: Does the example work if you hardcode the dockerfile value, instead of the template reference? |
Yep, hardcoding or simply removing the |
Got it, thanks! I'll address this ahead of tomorrow's release. |
Actually I'm so far failing to reproduce this. Using the exact example you provided (adding the One possibility is that it's already something fixed on the current master, or that there's something different in our environments. I'm also using Docker Desktop, albeit on Mac. Perhaps you could test the latest edge build? https://github.com/garden-io/garden/releases/tag/untagged-a1a702f18adcb4d63d5e |
There have also been a couple of patch releases since 0.12.13, so I'd be curious if 0.12.15 has the same problem. |
Hi Jon, thanks for looking into it! I've just tried the latest 0.12.15 with an empty kubernetes cluster and still got the same result. Anything else that could differ between our systems in garden's point of view?
|
I think I figured it out. That was a subtle one. I'll see if I can fix this ahead of the release, want to make sure we don't accidentally break something else. |
Previously, we would immediately resolve an optional template string as undefined during partial resolution, which would cause problems when using optional template strings for variables that are only available later in the process. We now leave them unchanged until the final resolution occurs. Fixes #2241
Previously, we would immediately resolve an optional template string as undefined during partial resolution, which would cause problems when using optional template strings for variables that are only available later in the process. We now leave them unchanged until the final resolution occurs. Fixes #2241
Bug
After upgrading garden to v0.12.13, my workflow broke. I've boiled it down to handling of optional variables, in my case it's the definition of a Dockerfile within a
container
module.Current Behavior
The
container
module tries to pull the givenimage
instead of building it. This is because it doesn't recognize a Dockerfile, given through the instructiondockerfile: ${var.dockerfile}
.Expected behavior
The workflow should work exactly the same as with 0.12.12.
Reproducible example
garden.yml
Dockerfile.example:
FROM nginx
garden 0.12.12:
garden 0.12.13 onwards:
Workaround
Stay on 0.12.12 or omit optional variables (not applicable in my case).
Suggested solution(s)
Fix handling of optional variables.
Additional context
I didn't test other scenarios than the one with
dockerfile
listed in the example above. It may a corner case ofdockerfile
, but I believe it's the general template variable handling that has changed with 0.12.13.Your environment
garden version
0.12.13
The text was updated successfully, but these errors were encountered: