1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-30 05:59:39 +02:00

fix(helmExecute): do not publish helm charts under subfolders (#4065)

This commit is contained in:
Pavel Busko 2022-11-22 09:35:22 +01:00 committed by GitHub
parent a055b905f9
commit 959fa964b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -426,9 +426,7 @@ func (h *HelmExecute) RunHelmPublish() (string, error) {
h.utils.SetOptions(repoClientOptions)
binary := fmt.Sprintf("%v", h.config.DeploymentName+"-"+h.config.PublishVersion+".tgz")
targetPath := fmt.Sprintf("%v/%s", h.config.DeploymentName, binary)
binary := fmt.Sprintf("%s-%s.tgz", h.config.DeploymentName, h.config.PublishVersion)
separator := "/"
@ -436,7 +434,7 @@ func (h *HelmExecute) RunHelmPublish() (string, error) {
separator = ""
}
targetURL := fmt.Sprintf("%s%s%s", h.config.TargetRepositoryURL, separator, targetPath)
targetURL := fmt.Sprintf("%s%s%s", h.config.TargetRepositoryURL, separator, binary)
log.Entry().Infof("publishing artifact: %s", targetURL)

View File

@ -540,8 +540,8 @@ func TestRunHelmPublish(t *testing.T) {
targetURL, err := helmExecute.RunHelmPublish()
if assert.NoError(t, err) {
assert.Equal(t, 1, len(utils.FileUploads))
assert.Equal(t, "https://my.target.repository.local/test_helm_chart/test_helm_chart-1.2.3.tgz", targetURL)
assert.Equal(t, "https://my.target.repository.local/test_helm_chart/test_helm_chart-1.2.3.tgz", utils.FileUploads["test_helm_chart-1.2.3.tgz"])
assert.Equal(t, "https://my.target.repository.local/test_helm_chart-1.2.3.tgz", targetURL)
assert.Equal(t, "https://my.target.repository.local/test_helm_chart-1.2.3.tgz", utils.FileUploads["test_helm_chart-1.2.3.tgz"])
}
})
}