fix: Build.Repo and Build.CacheRepo now uses buildRepo() (#40)
This commit is contained in:
parent
8bd45524d4
commit
fae9271dc7
|
@ -206,13 +206,13 @@ func run(c *cli.Context) error {
|
||||||
ExpandTag: c.Bool("expand-tag"),
|
ExpandTag: c.Bool("expand-tag"),
|
||||||
Args: c.StringSlice("args"),
|
Args: c.StringSlice("args"),
|
||||||
Target: c.String("target"),
|
Target: c.String("target"),
|
||||||
Repo: c.String("repo"),
|
Repo: buildRepo(c.String("registry"), c.String("repo")),
|
||||||
Mirrors: c.StringSlice("registry-mirrors"),
|
Mirrors: c.StringSlice("registry-mirrors"),
|
||||||
Labels: c.StringSlice("custom-labels"),
|
Labels: c.StringSlice("custom-labels"),
|
||||||
SkipTlsVerify: c.Bool("skip-tls-verify"),
|
SkipTlsVerify: c.Bool("skip-tls-verify"),
|
||||||
SnapshotMode: c.String("snapshot-mode"),
|
SnapshotMode: c.String("snapshot-mode"),
|
||||||
EnableCache: c.Bool("enable-cache"),
|
EnableCache: c.Bool("enable-cache"),
|
||||||
CacheRepo: c.String("cache-repo"),
|
CacheRepo: buildRepo(c.String("registry"), c.String("cache-repo")),
|
||||||
CacheTTL: c.Int("cache-ttl"),
|
CacheTTL: c.Int("cache-ttl"),
|
||||||
DigestFile: defaultDigestFile,
|
DigestFile: defaultDigestFile,
|
||||||
NoPush: noPush,
|
NoPush: noPush,
|
||||||
|
@ -268,6 +268,8 @@ func buildRepo(registry, repo string) string {
|
||||||
// No custom registry, just return the repo name
|
// No custom registry, just return the repo name
|
||||||
return repo
|
return repo
|
||||||
}
|
}
|
||||||
|
// Trim off trailing slash to prevent double slash when combining with repo
|
||||||
|
registry = strings.TrimSuffix(registry, "/")
|
||||||
if strings.HasPrefix(repo, registry+"/") {
|
if strings.HasPrefix(repo, registry+"/") {
|
||||||
// Repo already includes the registry prefix
|
// Repo already includes the registry prefix
|
||||||
// For backward compatibility, we won't add the prefix again.
|
// For backward compatibility, we won't add the prefix again.
|
||||||
|
|
Loading…
Reference in New Issue