Skip to content
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

bake: improve error when using incorrect format for setting labels #2778

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

jsternberg
Copy link
Collaborator

Improves the error message when using an incorrect format for setting labels. This includes the intended format directly in the error message instead of assuming the user knows what the format is.

Fixes #2315.

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively this could be in the style of "invalid format for _ , expecting _"

@jsternberg jsternberg force-pushed the improve-missing-name-set-error branch from e7dcf1f to 55c2ea9 Compare November 4, 2024 18:53
@jsternberg
Copy link
Collaborator Author

Done. Updated the message. I think that likely communicates more explicitly.

bake/bake.go Outdated
@@ -865,23 +867,23 @@ func (t *Target) AddOverrides(overrides map[string]Override) error {
t.Dockerfile = &value
case "args":
if len(keys) != 2 {
return errors.Errorf("args require name")
return errors.Errorf("invalid format for args, expecting args.${name}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe args.<name>=<value>

Improves the error message when using an incorrect format for setting
labels. This includes the intended format directly in the error message
instead of assuming the user knows what the format is.

Signed-off-by: Jonathan A. Sternberg <[email protected]>
@jsternberg jsternberg force-pushed the improve-missing-name-set-error branch from 55c2ea9 to a5bb117 Compare November 4, 2024 20:38
@crazy-max crazy-max merged commit 850e533 into docker:master Nov 6, 2024
106 checks passed
@crazy-max crazy-max added this to the v0.19.0 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bake: improve error message when using incorrect format for setting labels
3 participants