code: func getAPITagFromNamedRef(ref reference.Named) string {
  	if digested, ok := ref.(reference.Digested); ok {
  		return digested.Digest().String()
  	}
  	ref = reference.TagNameOnly(ref)
  	if tagged, ok := ref.(reference.Tagged); ok {
  		return tagged.Tag()
  	}
  	return ""
  }
docs: // getAPITagFromNamedRef returns a tag from the specified reference.
  // This function is necessary as long as the docker "server" api expects
  // digests to be sent as tags and makes a distinction between the name
  // and tag/digest part of a reference.