Skip to content

Conversation

tonistiigi
Copy link
Member

Contexts using target: schema are replaced by input: pointing to previous build result before build request is sent. Currently this replacement did not work if multiple contexts pointed to the same target name.

This happened because there is a map pointing back from result to the calling context. Previously one of the contexts (with random order) would be correctly replaced and another would be sent to buildkit as target: (where it would error is something wants to use it because it can't be resolved).

Example case:

target "base" {
  target = "base"
}

target "base2" {
  target = "base2"
}

target "default" {
  contexts = {
    one = "target:base"
    two = "target:base"
    three = "target:base2"
  }

}

Contexts using target: schema are replaced by input: pointing
to previous build result before build request is sent. Currently
this replacement did not work if multiple contexts pointed to
the same target name.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
for platform, r := range rr.Refs {
st, err := r.ToState()

for _, v := range contexts {
Copy link
Member Author

Choose a reason for hiding this comment

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

View the diff with withspace disabled as only the indention changed.

@tonistiigi tonistiigi requested a review from crazy-max May 8, 2024 23:49
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.

3 participants