Skip to content

Commit ea86bb3

Browse files
authored
bug(docker-promote): added a check for a different target repository (#52)
1 parent 35ab366 commit ea86bb3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: cmd/vela-artifactory/docker_promote.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ func (p *DockerPromote) Exec(c *Config) error {
8383
}
8484

8585
if p.PromoteProperty {
86-
promotedImagePath := fmt.Sprintf("%s/%s", payload.GetDockerRepository(), payload.GetTargetTag())
86+
var promotedImagePath string
87+
88+
if payload.GetTargetDockerRepository() != "" {
89+
promotedImagePath = fmt.Sprintf("%s/%s", payload.GetTargetDockerRepository(), payload.GetTargetTag())
90+
} else {
91+
promotedImagePath = fmt.Sprintf("%s/%s", payload.GetDockerRepository(), payload.GetTargetTag())
92+
}
8793

8894
properties := make(map[string][]string)
8995
properties["promoted_on"] = append(properties["promoted_on"], time.Now().UTC().Format(time.RFC3339))

0 commit comments

Comments
 (0)