Merge pull request #3168 from tonistiigi/bake-call-empty

bake: fix nil deference on empty call definition
This commit is contained in:
CrazyMax 2025-05-12 09:13:05 +02:00 committed by GitHub
commit 7e960152a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -261,13 +261,18 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
return err
}
for _, opt := range bo {
for k, opt := range bo {
if opt.CallFunc != nil {
cf, err := buildflags.ParseCallFunc(opt.CallFunc.Name)
if err != nil {
return err
}
opt.CallFunc.Name = cf.Name
if cf == nil {
opt.CallFunc = nil
bo[k] = opt
} else {
opt.CallFunc.Name = cf.Name
}
}
}