Skip to content

Commit

Permalink
Merge pull request #236 from smarterclayton/warn_only_if_set
Browse files Browse the repository at this point in the history
Bug 1827672: Only warn if PublicDockerImageRepository is set
  • Loading branch information
openshift-merge-robot committed Apr 24, 2020
2 parents 72c1eea + 979de22 commit 861af92
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/imagestream/imagestream.go
Expand Up @@ -257,12 +257,14 @@ func (is *imageStream) localRegistry(ctx context.Context) ([]string, *rerrors.Er
localNames = append(localNames, local.Registry)
}

public, err := imageapi.ParseDockerImageReference(stream.Status.PublicDockerImageRepository)
if err != nil {
dcontext.GetLogger(ctx).Warnf("localRegistry: unable to parse publicDockerImageRepository %q", stream.Status.PublicDockerImageRepository)
}
if len(public.Registry) != 0 {
localNames = append(localNames, public.Registry)
if len(stream.Status.PublicDockerImageRepository) > 0 {
public, err := imageapi.ParseDockerImageReference(stream.Status.PublicDockerImageRepository)
if err != nil {
dcontext.GetLogger(ctx).Warnf("localRegistry: unable to parse publicDockerImageRepository %q", stream.Status.PublicDockerImageRepository)
}
if len(public.Registry) != 0 {
localNames = append(localNames, public.Registry)
}
}

return localNames, nil
Expand Down

0 comments on commit 861af92

Please sign in to comment.