Browse Source

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 <[email protected]>
Pablo Rodriguez Quesada 3 years ago
parent
commit
eb06e1ca56
1 changed files with 3 additions and 3 deletions
  1. 3 3
      pkg/compose/build.go

+ 3 - 3
pkg/compose/build.go

@@ -189,11 +189,11 @@ func (s *composeService) getLocalImagesDigests(ctx context.Context, project *typ
 		images[name] = info.ID
 		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]
 		digest, ok := images[imgName]
 		if ok {
 		if ok {
-			s.CustomLabels[api.ImageDigestLabel] = digest
+			project.Services[i].CustomLabels.Add(api.ImageDigestLabel, digest)
 		}
 		}
 	}
 	}