Give namespace precedence in calc artifact path

This commit is contained in:
Hidde Beydals 2020-04-12 21:04:50 +02:00
parent 7e99998c5f
commit 3e0810aefe
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ func NewStorage(basePath string, hostname string, timeout time.Duration) (*Stora
// ArtifactFor returns an artifact for the given Kubernetes object
func (s *Storage) ArtifactFor(kind string, metadata metav1.Object, fileName, revision string) sourcev1.Artifact {
path := fmt.Sprintf("%s/%s-%s/%s", kind, metadata.GetName(), metadata.GetNamespace(), fileName)
kind = strings.ToLower(kind)
path := fmt.Sprintf("%s/%s-%s/%s", kind, metadata.GetNamespace(), metadata.GetName(), fileName)
localPath := filepath.Join(s.BasePath, path)
url := fmt.Sprintf("http://%s/%s", s.Hostname, path)