Merge pull request #9579 from paroque28/patch-1

build.go: initialize CustomLabels map if nil
This commit is contained in:
Guillaume Lours 2022-07-12 12:44:49 +02:00 committed by GitHub
commit 6c8ff02c07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -189,11 +189,11 @@ func (s *composeService) getLocalImagesDigests(ctx context.Context, project *typ
images[name] = info.ID
}
for _, s := range project.Services {
imgName := getImageName(s, project.Name)
for i := range project.Services {
imgName := getImageName(project.Services[i], project.Name)
digest, ok := images[imgName]
if ok {
s.CustomLabels[api.ImageDigestLabel] = digest
project.Services[i].CustomLabels.Add(api.ImageDigestLabel, digest)
}
}