mirror of https://github.com/harness/drone.git
fix: [AH-1139]: fix pull command for helm artifact (#3593)
* fix: [AH-1139]: fix failing tests * fix: [AH-1139]: fix failing tests * fix: [AH-1139]: fix pull command for helm artifactmain
parent
bfed597d43
commit
0c7097d4b7
|
@ -382,7 +382,7 @@ func GetDockerPullCommand(
|
|||
}
|
||||
|
||||
func GetHelmPullCommand(image string, tag string, registryURL string) string {
|
||||
return "helm pull oci://" + GetRepoURLWithoutProtocol(registryURL) + "/" + image + ":" + tag
|
||||
return "helm pull oci://" + GetRepoURLWithoutProtocol(registryURL) + "/" + image + " --version " + tag
|
||||
}
|
||||
|
||||
func GetGenericArtifactFileDownloadCommand(regURL, artifact, version, filename string) string {
|
||||
|
|
|
@ -147,7 +147,7 @@ func TestGetTagURL_ValidURL(t *testing.T) {
|
|||
func TestGetPullCommand_ValidCommand(t *testing.T) {
|
||||
assert.Equal(t, "docker pull example.com/image:tag",
|
||||
GetPullCommand("image", "tag", "DOCKER", "https://example.com"))
|
||||
assert.Equal(t, "helm pull oci://example.com/image:tag",
|
||||
assert.Equal(t, "helm pull oci://example.com/image --version tag",
|
||||
GetPullCommand("image", "tag", "HELM", "https://example.com"))
|
||||
assert.Equal(t, "", GetPullCommand("image", "tag", "INVALID", "https://example.com"))
|
||||
}
|
||||
|
@ -157,5 +157,6 @@ func TestGetDockerPullCommand_ValidCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestGetHelmPullCommand_ValidCommand(t *testing.T) {
|
||||
assert.Equal(t, "helm pull oci://example.com/image:tag", GetHelmPullCommand("image", "tag", "https://example.com"))
|
||||
assert.Equal(t, "helm pull oci://example.com/image --version tag",
|
||||
GetHelmPullCommand("image", "tag", "https://example.com"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue