Skip to content

[v0.19] bake: remove empty values set by --set#2861

Merged
tonistiigi merged 2 commits into
docker:v0.19from
tonistiigi:v0.19-set-empty-eof
Dec 16, 2024
Merged

[v0.19] bake: remove empty values set by --set#2861
tonistiigi merged 2 commits into
docker:v0.19from
tonistiigi:v0.19-set-empty-eof

Conversation

@tonistiigi

Copy link
Copy Markdown
Member

regression from b2c0c26
fixes #2858 for v0.19

These parser functions are called for --set to
resolve entitlement paths that would be automatically added and will fail for empty value.

The empty values would already be ignored but in v0.19 is done after merging the --set values and then calling parse again.

@tonistiigi tonistiigi requested a review from crazy-max December 16, 2024 07:20
@tonistiigi tonistiigi added this to the v0.19.3 milestone Dec 16, 2024
@crazy-max

crazy-max commented Dec 16, 2024

Copy link
Copy Markdown
Member

https://github.com/docker/buildx/actions/runs/12347799964/job/34460332018?pr=2861#step:6:183

Needs to pick the xx update

edit: done in #2862, needs rebase

These parser functions are called for `--set` to
resolve entitlement paths that would be automatically added
and will fail for empty value.

The empty values would already be ignored but in v0.19 is
done after merging the `--set` values and then calling
parse again.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max

Copy link
Copy Markdown
Member

@tonistiigi Pushed extra commit to test empty override

Comment thread bake/bake_test.go
Comment on lines +2032 to +2047
// https://github.com/docker/buildx/issues/2858
func TestOverrideEmpty(t *testing.T) {
fp := File{
Name: "docker-bake.hcl",
Data: []byte(`
target "app" {
output = ["./bin"]
}
`),
}

ctx := context.TODO()

_, _, err := ReadTargets(ctx, []File{fp}, []string{"app"}, []string{"app.output="}, nil, &EntitlementConf{})
require.NoError(t, err)
}

@crazy-max crazy-max Dec 16, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fyi @jsternberg, we should pick this in #2814

@tonistiigi tonistiigi marked this pull request as ready for review December 16, 2024 18:15
@tonistiigi tonistiigi merged commit 62d486d into docker:v0.19 Dec 16, 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.

2 participants