build.go: Access customLabels directly instead of by reference

Accesing the map directly instead of the copy value, otherwise the label doesn't get set.

Signed-off-by: Pablo Rodriguez <pablo.aarch64@gmail.com>
This commit is contained in:
Pablo Rodriguez Quesada 2022-06-20 23:00:26 -06:00 committed by Pablo Rodriguez
parent 5bc4016e70
commit eb06e1ca56
No known key found for this signature in database
GPG Key ID: C13A8F20A94D5414
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)
}
}