Browse Source

c8d/history: Fill ID for parents without the label

When choosing the next image, don't reject images without the classic
builder parent label. The intention was to *prefer* images them instead
of making that a condition.
This fixes the ID not being filled for parent images that weren't built
with the classic builder.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 1 year ago
parent
commit
cdb44010c9
1 changed files with 2 additions and 1 deletions
  1. 2 1
      daemon/containerd/image_history.go

+ 2 - 1
daemon/containerd/image_history.go

@@ -121,7 +121,8 @@ func (i *ImageService) ImageHistory(ctx context.Context, name string) ([]*imaget
 
 		foundNext := false
 		for _, img := range parents {
-			if _, ok := img.Labels[imageLabelClassicBuilderParent]; ok {
+			_, hasLabel := img.Labels[imageLabelClassicBuilderParent]
+			if !foundNext || hasLabel {
 				currentImg = img
 				foundNext = true
 			}