Skip to content

Commit 2ac0cf7

Browse files
authored
Merge pull request #12 from malc0lm/default-target
If target repo is empty, target repo will be set Default Registry and…
2 parents 74bcc3e + 4979729 commit 2ac0cf7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/image-transfer/run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,11 +800,11 @@ func (c *Client) GenTagURLPair(source string, target string, wg *sync.WaitGroup)
800800
return fmt.Errorf("url %s format error: %v", source, err)
801801
}
802802

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

0 commit comments

Comments
 (0)