Strip quotes from modifier arg in all Dockerfiles #35427
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modifiers are used to dynamically pass ARGs to Dockerfiles. While building images in CI, for example while building images with race detection enabled, modifiers are set to
"LOCKDEBUG=1 RACE=1"
. Quotes don't get interpreted and are considered just like any other character, this leads to make interpreting"LOCKDEBUG
to1
andRACE
to1"
. This works currently because in most cases we simply check if the variable is non-empty. This is especially confusing if a new variable is added to modifiers and evaluated against actual value passed in.Noticed this while trying to add a new variable in #35328
We do have shell set to bash everywhere, So I'm not sure why quotes aren't trimmed by the shell before passing it on to docker builder in CI.
cilium/Makefile.defs
Lines 4 to 5 in 98ada1a