Merge pull request #88 from infosiftr/docker-push-on-index
Fix fetchRegistryImageIds (which is only used for "docker push" no-op) to no longer return members of an index/manifest list
This commit is contained in:
commit
36b3473420
|
|
@ -28,6 +28,12 @@ func fetchRegistryImageIds(image string) []string {
|
||||||
return ids
|
return ids
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ids := []string{}
|
||||||
|
if img.IsImageIndex() {
|
||||||
|
ids = append(ids, digest)
|
||||||
|
return ids // see note above -- this function is used for "docker push" which does not and cannot (currently) support a manifest list / image index
|
||||||
|
}
|
||||||
|
|
||||||
manifests, err := img.Manifests(ctx)
|
manifests, err := img.Manifests(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if debugFlag {
|
if debugFlag {
|
||||||
|
|
@ -36,10 +42,8 @@ func fetchRegistryImageIds(image string) []string {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ids := []string{}
|
// TODO balk if manifests has more than one entry in it
|
||||||
if img.IsImageIndex() {
|
|
||||||
ids = append(ids, digest)
|
|
||||||
}
|
|
||||||
for _, manifestDesc := range manifests {
|
for _, manifestDesc := range manifests {
|
||||||
ids = append(ids, manifestDesc.Digest.String())
|
ids = append(ids, manifestDesc.Digest.String())
|
||||||
manifest, err := img.At(manifestDesc).Manifest(ctx)
|
manifest, err := img.At(manifestDesc).Manifest(ctx)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue