buildinfo: filter attrs while merging metadata in bridge result

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
master
CrazyMax 2022-02-17 16:18:06 +01:00
parent 3ed526759f
commit 292c0bf6f4
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
1 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ func GetMetadata(metadata map[string][]byte, key string, reqFrontend string, req
if reqFrontend != "" { if reqFrontend != "" {
mbi.Frontend = reqFrontend mbi.Frontend = reqFrontend
} }
mbi.Attrs = convertMap(reduceMap(reqAttrs, mbi.Attrs)) mbi.Attrs = filterAttrs(convertMap(reduceMap(reqAttrs, mbi.Attrs)))
dtbi, err = json.Marshal(mbi) dtbi, err = json.Marshal(mbi)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "failed to marshal build info for %q", key) return nil, errors.Wrapf(err, "failed to marshal build info for %q", key)
@ -247,7 +247,7 @@ func GetMetadata(metadata map[string][]byte, key string, reqFrontend string, req
} else { } else {
dtbi, err = json.Marshal(binfotypes.BuildInfo{ dtbi, err = json.Marshal(binfotypes.BuildInfo{
Frontend: reqFrontend, Frontend: reqFrontend,
Attrs: convertMap(reqAttrs), Attrs: filterAttrs(convertMap(reqAttrs)),
}) })
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "failed to marshal build info for %q", key) return nil, errors.Wrapf(err, "failed to marshal build info for %q", key)