Skip to content

Commit

Permalink
pkg: storage: provide an hint when pulling w/o registries configured
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
  • Loading branch information
runcom committed May 16, 2018
1 parent 72cb448 commit 9faf847
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/storage/image.go
Expand Up @@ -28,6 +28,8 @@ var (
ErrCannotParseImageID = errors.New("cannot parse an image ID")
// ErrImageMultiplyTagged is returned when we try to remove an image that still has multiple names
ErrImageMultiplyTagged = errors.New("image still has multiple names applied")
// ErrNoRegistriesConfigured is returned when there are no registries configured in /etc/crio.conf#additional_registries
ErrNoRegistriesConfigured = errors.New(`no registries configured while trying to pull an unqualified image, add at least one in /etc/crio/crio.conf under the "registries" key`)
)

// ImageResult wraps a subset of information about an image: its ID, its names,
Expand Down Expand Up @@ -580,7 +582,7 @@ func (svc *imageService) ResolveNames(imageName string) ([]string, error) {
// we got an unqualified image here, we can't go ahead w/o registries configured
// properly.
if len(svc.registries) == 0 {
return nil, errors.New("no registries configured while trying to pull an unqualified image")
return nil, ErrNoRegistriesConfigured
}
// this means we got an image in the form of "busybox"
// we need to use additional registries...
Expand Down

0 comments on commit 9faf847

Please sign in to comment.