Skip to content

Commit

Permalink
bug(docker-promote): added a check for a different target repository (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblbeck authored Aug 11, 2020
1 parent 35ab366 commit ea86bb3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/vela-artifactory/docker_promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ func (p *DockerPromote) Exec(c *Config) error {
}

if p.PromoteProperty {
promotedImagePath := fmt.Sprintf("%s/%s", payload.GetDockerRepository(), payload.GetTargetTag())
var promotedImagePath string

if payload.GetTargetDockerRepository() != "" {
promotedImagePath = fmt.Sprintf("%s/%s", payload.GetTargetDockerRepository(), payload.GetTargetTag())
} else {
promotedImagePath = fmt.Sprintf("%s/%s", payload.GetDockerRepository(), payload.GetTargetTag())
}

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

0 comments on commit ea86bb3

Please sign in to comment.