From 98049e7eda74adcb8cc2cbeb90110d3288be9d8d Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Wed, 7 Dec 2022 19:15:58 +0000 Subject: [PATCH] build: don't set add-hosts option if empty This looks like an oversight, all of the other options have similar checks. This can interfere with generated provenance where "add-hosts" will be marked as an argument to the build, even though it's not actually being utilized. Signed-off-by: Justin Chadwell --- build/build.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/build.go b/build/build.go index 4143bc0d..a460e1b3 100644 --- a/build/build.go +++ b/build/build.go @@ -607,7 +607,9 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op if err != nil { return nil, nil, err } - so.FrontendAttrs["add-hosts"] = extraHosts + if len(extraHosts) > 0 { + so.FrontendAttrs["add-hosts"] = extraHosts + } // setup shm size if opt.ShmSize.Value() > 0 {