Skip to content

Commit 2ffdc48

Browse files
Merge pull request #16319 from mfojtik/fix-import
Automatic merge from submit-queue image: set error when we receive unknown schema for the image @dmage @soltysh The error we get is: ```console I0913 06:32:59.350152 24974 importer.go:551] unsupported manifest type: *manifestlist.DeserializedManifestList ``` This will result into the .Image field to be nil which we then later panic on. I'm not sure how this was not broken before or if something changed in DockerHub. The mongo and redis images in DockerHub both have manifest lists, but we should be converting them to schema2 automatically? This PR just propagate that error to image stream status instead of panicking the importer. We should investigate further.
2 parents 75e79bc + 445e55b commit 2ffdc48

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pkg/image/importer/importer.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,10 @@ func (isi *ImageStreamImporter) importRepositoryFromDocker(ctx gocontext.Context
490490

491491
importDigest.Image, err = schema2ToImage(deserializedManifest, imageConfig, d)
492492
} else {
493+
// TODO: Current this error means the imported received the manifest list
494+
// which we don't support yet.
495+
err = fmt.Errorf("unsupported image manifest schema: %T", manifest)
493496
glog.V(5).Infof("unsupported manifest type: %T", manifest)
494-
continue
495497
}
496498

497499
if err != nil {
@@ -548,8 +550,10 @@ func (isi *ImageStreamImporter) importRepositoryFromDocker(ctx gocontext.Context
548550
}
549551
importTag.Image, err = schema2ToImage(deserializedManifest, imageConfig, "")
550552
} else {
553+
// TODO: Current this error means the imported received the manifest list
554+
// which we don't support yet.
555+
err = fmt.Errorf("unsupported image manifest schema: %T", manifest)
551556
glog.V(5).Infof("unsupported manifest type: %T", manifest)
552-
continue
553557
}
554558

555559
if err != nil {

vendor/github.com/docker/distribution/manifest/manifestlist/manifestlist.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)