code: func (c *Cluster) imageWithDigestString(ctx context.Context, image string, authConfig *apitypes.AuthConfig) (string, error) {
  	ref, err := reference.ParseAnyReference(image)
  	if err != nil {
  		return "", err
  	}
  	namedRef, ok := ref.(reference.Named)
  	if !ok {
  		if _, ok := ref.(reference.Digested); ok {
  			return image, nil
  		}
  		return "", errors.Errorf("unknown image reference format: %s", image)
  	}
  	// only query registry if not a canonical reference (i.e. with digest)
  	if _, ok := namedRef.(reference.Canonical); !ok {
  		namedRef = reference.TagNameOnly(namedRef)
  
  		taggedRef, ok := namedRef.(reference.NamedTagged)
  		if !ok {
  			return "", errors.Errorf("image reference not tagged: %s", image)
  		}
  
  		repo, _, err := c.config.ImageBackend.GetRepository(ctx, taggedRef, authConfig)
  		if err != nil {
  			return "", err
  		}
  		dscrptr, err := repo.Tags(ctx).Get(ctx, taggedRef.Tag())
  		if err != nil {
  			return "", err
  		}
  
  		namedDigestedRef, err := reference.WithDigest(taggedRef, dscrptr.Digest)
  		if err != nil {
  			return "", err
  		}
  		// return familiar form until interface updated to return type
  		return reference.FamiliarString(namedDigestedRef), nil
  	}
  	// reference already contains a digest, so just return it
  	return reference.FamiliarString(ref), nil
  }
docs: // imageWithDigestString takes an image such as name or name:tag
  // and returns the image pinned to a digest, such as name@sha256:34234