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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

bake: fix global target access when using a matrix #2106

Merged
merged 1 commit into from Nov 6, 2023

Conversation

jedevc
Copy link
Collaborator

@jedevc jedevc commented Nov 2, 2023

Fixes #2104

Previously, we would fail while trying to use the global "target" field when using a matrix. The contents of the matrix really don't matter for this.

What was happening was that we would copy the "target" property into the child evaluation context, so that when it was updated on the parent, it wouldn't propagate to the child. The correct behavior here is to avoid copying variables from the target evaluation context if it is the root.

Pretty simple fix (a bit of a trickier investigation), but also added a test to make sure we don't hit this again. Honestly, a bit surprised this never showed up before 馃槺

Previously, we would fail while trying to use the global "target" field
when using a matrix. The contents of the matrix really don't matter for
this.

What was happening was that we would copy the "target" property into the
child evaluation context, so that when it was updated on the parent, it
wouldn't propagate to the child. The correct behavior here is to avoid
copying variables from the target evaluation context if it is the
root.

Signed-off-by: Justin Chadwell <me@jedevc.com>
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@crazy-max crazy-max merged commit 08a70ec into docker:master Nov 6, 2023
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bake: Resource interpolation on matrix target
3 participants