Skip to content

bake: allow empty overrides to clear arrays - #4107

Draft
crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-bake-empty-array-overrides
Draft

crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-bake-empty-array-overrides

Conversation

@crazy-max

Copy link
Copy Markdown
Member

This makes a final empty array override explicitly clear values from the Bake definition and earlier --set flags. This allows callers to enforce that configuration such as tags is absent by passing --set '*.tags=', instead of having the empty override ignored and unintentionally retaining values supplied.

Non-empty assignments and += retain their existing replacement and append behavior. Empty assignments also clear append-by-default fields such as annotations, attestations, and entitlements, while unsupported subkeys on array fields are now rejected so they cannot bypass a later clear.

Treat a final non-append empty value as an explicit reset of values from Bake
definitions and earlier --set flags. Preserve append-by-default behavior for
non-empty overrides while allowing empty values to clear them.

Reject unsupported array subkeys so differently keyed overrides cannot bypass
a later clear.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
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.

1 participant