mirror of
https://github.com/containers/skopeo.git
synced 2025-07-14 06:55:01 +00:00
Merge pull request #499 from mtrmac/no-docker.Image
Stop using docker.Image
This commit is contained in:
commit
81837bd55b
@ -96,10 +96,10 @@ var inspectCmd = cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
outputData := inspectOutput{
|
outputData := inspectOutput{
|
||||||
Name: "", // Possibly overridden for a docker.Image.
|
Name: "", // Set below if DockerReference() is known
|
||||||
Tag: imgInspect.Tag,
|
Tag: imgInspect.Tag,
|
||||||
// Digest is set below.
|
// Digest is set below.
|
||||||
RepoTags: []string{}, // Possibly overriden for a docker.Image.
|
RepoTags: []string{}, // Possibly overriden for docker.Transport.
|
||||||
Created: imgInspect.Created,
|
Created: imgInspect.Created,
|
||||||
DockerVersion: imgInspect.DockerVersion,
|
DockerVersion: imgInspect.DockerVersion,
|
||||||
Labels: imgInspect.Labels,
|
Labels: imgInspect.Labels,
|
||||||
@ -111,9 +111,15 @@ var inspectCmd = cli.Command{
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error computing manifest digest: %v", err)
|
return fmt.Errorf("Error computing manifest digest: %v", err)
|
||||||
}
|
}
|
||||||
if dockerImg, ok := img.(*docker.Image); ok {
|
if dockerRef := img.Reference().DockerReference(); dockerRef != nil {
|
||||||
outputData.Name = dockerImg.SourceRefFullName()
|
outputData.Name = dockerRef.Name()
|
||||||
outputData.RepoTags, err = dockerImg.GetRepositoryTags(ctx)
|
}
|
||||||
|
if img.Reference().Transport() == docker.Transport {
|
||||||
|
sys, err := contextFromGlobalOptions(c, "")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
outputData.RepoTags, err = docker.GetRepositoryTags(ctx, sys, img.Reference())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// some registries may decide to block the "list all tags" endpoint
|
// some registries may decide to block the "list all tags" endpoint
|
||||||
// gracefully allow the inspect to continue in this case. Currently
|
// gracefully allow the inspect to continue in this case. Currently
|
||||||
|
Loading…
Reference in New Issue
Block a user