fix: incorrect version of MediaTypeManifest makes it backup failed

This commit is contained in:
yangk 2022-07-12 16:36:32 +08:00
parent 447ab85000
commit c131aed4b1

View File

@ -333,8 +333,14 @@ func (b *BackupAPPNew) checkVersionExist(version *dbmodel.VersionInfo) (bool, er
}
_, err = reg.Manifest(imageInfo.Name, imageInfo.Tag)
if err != nil {
logrus.Errorf("get image %s manifest info failure [%v], it could be not exist", version.DeliveredPath, err)
return false, err
logrus.Errorf("get image [%s] manifest info failure [%v], it could be not exist", version.DeliveredPath, err)
// Compatible with MediaTypeManifest
_, err := reg.ManifestV2(imageInfo.Name, imageInfo.Tag)
if err != nil {
logrus.Errorf("get image [%s] manifestV2 info failure [%v], it could be not exist", version.DeliveredPath, err)
return false, err
}
return true, nil
}
return true, nil
}