diff --git a/directory/directory.go b/directory/directory.go index 49bb5765..e41854ec 100644 --- a/directory/directory.go +++ b/directory/directory.go @@ -77,10 +77,10 @@ func NewDirImageSource(dir string) types.ImageSource { return &dirImageSource{dir} } -// GetIntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ +// IntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. // May be "" if unknown. -func (s *dirImageSource) GetIntendedDockerReference() string { +func (s *dirImageSource) IntendedDockerReference() string { return "" } diff --git a/docker/docker_image.go b/docker/docker_image.go index c9ab31b8..a708ddec 100644 --- a/docker/docker_image.go +++ b/docker/docker_image.go @@ -35,11 +35,11 @@ func NewDockerImage(img, certPath string, tlsVerify bool) (types.Image, error) { return &dockerImage{src: s}, nil } -// GetIntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ +// IntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. // May be "" if unknown. -func (i *dockerImage) GetIntendedDockerReference() string { - return i.src.GetIntendedDockerReference() +func (i *dockerImage) IntendedDockerReference() string { + return i.src.IntendedDockerReference() } // Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need. diff --git a/docker/docker_image_src.go b/docker/docker_image_src.go index 53bbd425..4277be8b 100644 --- a/docker/docker_image_src.go +++ b/docker/docker_image_src.go @@ -48,10 +48,10 @@ func NewDockerImageSource(img, certPath string, tlsVerify bool) (types.ImageSour return newDockerImageSource(img, certPath, tlsVerify) } -// GetIntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ +// IntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. // May be "" if unknown. -func (s *dockerImageSource) GetIntendedDockerReference() string { +func (s *dockerImageSource) IntendedDockerReference() string { return fmt.Sprintf("%s:%s", s.ref.Name(), s.tag) } diff --git a/openshift/openshift.go b/openshift/openshift.go index 2e549c0d..6425a928 100644 --- a/openshift/openshift.go +++ b/openshift/openshift.go @@ -186,10 +186,10 @@ func NewOpenshiftImageSource(imageName, certPath string, tlsVerify bool) (types. }, nil } -// GetIntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ +// IntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. // May be "" if unknown. -func (s *openshiftImageSource) GetIntendedDockerReference() string { +func (s *openshiftImageSource) IntendedDockerReference() string { return s.client.canonicalDockerReference() } diff --git a/types/types.go b/types/types.go index a8f0e82c..1f1a4626 100644 --- a/types/types.go +++ b/types/types.go @@ -30,10 +30,10 @@ type Repository interface { // ImageSource is a service, possibly remote (= slow), to download components of a single image. type ImageSource interface { - // GetIntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ + // IntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. // May be "" if unknown. - GetIntendedDockerReference() string + IntendedDockerReference() string // GetManifest returns the image's manifest. It may use a remote (= slow) service. GetManifest() (manifest []byte, unverifiedCanonicalDigest string, err error) GetLayer(digest string) (io.ReadCloser, error) @@ -53,10 +53,10 @@ type ImageDestination interface { // Image is a Docker image in a repository. type Image interface { // ref to repository? - // GetIntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ + // IntendedDockerReference returns the full, unambiguous, Docker reference for this image, _as specified by the user_ // (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image. // May be "" if unknown. - GetIntendedDockerReference() string + IntendedDockerReference() string // Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need. Manifest() ([]byte, error) // Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need.