plugins: fix panic installing from repo w/ digest
Only print the tag when the received reference has a tag, if we can't cast the received tag to a `reference.Tagged` then skip printing the tag as it's likely a digest. Fixes panic when trying to install a plugin from a reference with a digest such as `vieux/sshfs@sha256:1d3c3e42c12138da5ef7873b97f7f32cf99fb6edde75fa4f0bcf9ed277855811` Signed-off-by: Laura Brehm <laurabrehm@hey.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
51133117fb
commit
ba4a2dab16
1 changed files with 7 additions and 2 deletions
|
@ -200,8 +200,13 @@ func withFetchProgress(cs content.Store, out progress.Output, ref reference.Name
|
|||
switch desc.MediaType {
|
||||
case ocispec.MediaTypeImageManifest, images.MediaTypeDockerSchema2Manifest:
|
||||
tn := reference.TagNameOnly(ref)
|
||||
tagged := tn.(reference.Tagged)
|
||||
progress.Messagef(out, tagged.Tag(), "Pulling from %s", reference.FamiliarName(ref))
|
||||
var tagOrDigest string
|
||||
if tagged, ok := tn.(reference.Tagged); ok {
|
||||
tagOrDigest = tagged.Tag()
|
||||
} else {
|
||||
tagOrDigest = tn.String()
|
||||
}
|
||||
progress.Messagef(out, tagOrDigest, "Pulling from %s", reference.FamiliarName(ref))
|
||||
progress.Messagef(out, "", "Digest: %s", desc.Digest.String())
|
||||
return nil, nil
|
||||
case
|
||||
|
|
Loading…
Reference in a new issue