Fix assignment to nil map

Signed-off-by: David Gageot <david.gageot@docker.com>
This commit is contained in:
David Gageot 2022-10-04 08:30:47 +02:00
parent 105c214d15
commit 8fd34669ed
No known key found for this signature in database
GPG Key ID: 93C3F22BE5D3A40B
1 changed files with 3 additions and 0 deletions

View File

@ -801,6 +801,9 @@ func BuildWithResultHandler(ctx context.Context, drivers []DriverInfo, opt map[s
}
for n, v := range gitLabels {
if _, ok := opt.Labels[n]; !ok {
if opt.Labels == nil {
opt.Labels = map[string]string{}
}
opt.Labels[n] = v
}
}