Skip to content

Commit

Permalink
fix: Only append slash when missing for Artifactory repoURL (#11812)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan committed Sep 13, 2023
1 parent cff8b83 commit 4591af6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/apis/workflow/v1alpha1/artifact_repository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v1alpha1
import (
"fmt"
"path"
"strings"
)

var (
Expand Down Expand Up @@ -131,9 +132,9 @@ type ArtifactoryArtifactRepository struct {
}

func (r *ArtifactoryArtifactRepository) IntoArtifactLocation(l *ArtifactLocation) {
url := ""
if r.RepoURL != "" {
url = r.RepoURL + "/"
url := r.RepoURL
if !strings.HasSuffix(url, "/") {
url = url + "/"
}
k := r.KeyFormat
if k == "" {
Expand Down

0 comments on commit 4591af6

Please sign in to comment.