From b66988c824a888a2c78290adea3b054e8ef325ab Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Wed, 1 Feb 2023 10:12:36 +0000 Subject: [PATCH] bake: fix loop references Signed-off-by: Justin Chadwell (cherry picked from commit 48357ee0c6a2fb4e2e68e49ac06386f2fafa51c6) --- bake/compose.go | 1 + bake/remote.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bake/compose.go b/bake/compose.go index 990fcee1..8c4e5fe4 100644 --- a/bake/compose.go +++ b/bake/compose.go @@ -78,6 +78,7 @@ func ParseCompose(cfgs []compose.ConfigFile, envs map[string]string) (*Config, e // compose does not support nil values for labels labels := map[string]*string{} for k, v := range s.Build.Labels { + v := v labels[k] = &v } diff --git a/bake/remote.go b/bake/remote.go index 802e9209..939957d0 100644 --- a/bake/remote.go +++ b/bake/remote.go @@ -34,9 +34,9 @@ func ReadRemoteFiles(ctx context.Context, nodes []builder.Node, url string, name var files []File var node *builder.Node - for _, n := range nodes { + for i, n := range nodes { if n.Err == nil { - node = &n + node = &nodes[i] continue } }