diff --git a/registry/app/api/controller/metadata/utils.go b/registry/app/api/controller/metadata/utils.go index 1bc0a8a53..65b985c03 100644 --- a/registry/app/api/controller/metadata/utils.go +++ b/registry/app/api/controller/metadata/utils.go @@ -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 { diff --git a/registry/app/api/controller/metadata/utils_test.go b/registry/app/api/controller/metadata/utils_test.go index 3744313aa..2180bc352 100644 --- a/registry/app/api/controller/metadata/utils_test.go +++ b/registry/app/api/controller/metadata/utils_test.go @@ -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")) }