Skip to content

Commit

Permalink
Merge pull request #12 from malc0lm/default-target
Browse files Browse the repository at this point in the history
If target repo is empty, target repo will be set Default Registry and…
  • Loading branch information
malc0lm committed Sep 15, 2021
2 parents 74bcc3e + 4979729 commit 2ac0cf7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/image-transfer/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,11 @@ func (c *Client) GenTagURLPair(source string, target string, wg *sync.WaitGroup)
return fmt.Errorf("url %s format error: %v", source, err)
}

// if dest is not specific, use default registry and namespace
// if dest is not specific, use default registry and src repo
if target == "" {
if c.config.FlagConf.Config.DefaultRegistry != "" && c.config.FlagConf.Config.DefaultNamespace != "" {
if c.config.FlagConf.Config.DefaultRegistry != "" {
target = c.config.FlagConf.Config.DefaultRegistry + "/" +
c.config.FlagConf.Config.DefaultNamespace + "/" + sourceURL.GetRepoWithTag()
sourceURL.GetNamespace() + "/" + sourceURL.GetRepoWithTag()
} else {
return fmt.Errorf("the default registry and namespace should not be nil if you want to use them")
}
Expand Down

0 comments on commit 2ac0cf7

Please sign in to comment.