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>
This commit is contained in:
Paweł Gronowski 2023-10-19 16:38:26 +02:00
parent 29d863d451
commit cdb44010c9
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -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
}