Skip to content

Commit

Permalink
pkg/oci/remote: should handle error on name.NewRepository
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
  • Loading branch information
zchee committed May 16, 2022
1 parent 3284ba9 commit 80ab7ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/oci/remote/options.go
Expand Up @@ -127,7 +127,10 @@ func WithTargetRepository(repo name.Repository) Option {
func GetEnvTargetRepository() (name.Repository, error) {
if ro := os.Getenv(RepoOverrideEnvKey); ro != "" {
repo, err := name.NewRepository(ro)
return repo, fmt.Errorf("parsing $"+RepoOverrideEnvKey+": %w", err)
if err != nil {
return name.Repository{}, fmt.Errorf("parsing $"+RepoOverrideEnvKey+": %w", err)
}
return repo, nil
}
return name.Repository{}, nil
}

0 comments on commit 80ab7ef

Please sign in to comment.