Merge pull request #46680 from vvoland/c8d-history-off-by-one

c8d/history: Fill ID for parents without the label
This commit is contained in:
Sebastiaan van Stijn 2023-10-19 22:59:29 +02:00 committed by GitHub
commit 74641d2006
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}