-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add spec load pass to check for undefined build args #281
Add spec load pass to check for undefined build args #281
Conversation
Did you happen to look into using https://pkg.go.dev/github.com/moby/buildkit/frontend/dockerfile/shell?utm_source=godoc#Lex.ProcessWordWithMatches instead? |
Ah no, I was not aware that function existed. I will see if I can reimplement using that instead |
It looks like the version of this function you referenced exists in a newer version of buildkit (0.14.0) than the one we import in dalec (0.13.1). Are we ok to bump the buildkit dependency? |
Oh nice, yes we can/should bump it. |
4ea9b75
to
6a320db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MInor readability nit, but otherwise LGTM
What this PR does / why we need it:
Currently, if a build arg is not specified in the
args
section of a Dalec spec file, its value is set to""
when the spec is loaded. This is confusing behavior, as a user could easily forget to declare a build-arg or mistype a build-arg reference, leading to an empty string substitution which could be hard to track down.This PR adds an additional pass upon loading the spec which tokenizes all the build args first, and checks to ensure that each referenced arg does appear in the
args
section of the spec, raising an error if not.Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #274
Special notes for your reviewer: