Skip to content

Commit 6992299

Browse files
djyoutroydai
authored andcommitted
[ACR] Support pushing helm packages with path reference (#7358)
1 parent 02e2061 commit 6992299

File tree

1 file changed

+4
-3
lines changed
  • src/command_modules/azure-cli-acr/azure/cli/command_modules/acr

1 file changed

+4
-3
lines changed

src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/helm.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55

66
import re
7-
from os.path import isdir
7+
from os.path import isdir, basename
88

99
from knack.util import CLIError
1010
from knack.log import get_logger
@@ -113,7 +113,8 @@ def acr_helm_push(cmd,
113113
if isdir(chart_package):
114114
raise CLIError("Please run 'helm package {}' to generate a chart package first.".format(chart_package))
115115

116-
if not re.match(VALID_NAME, chart_package):
116+
chart_name = basename(chart_package)
117+
if not re.match(VALID_NAME, chart_name):
117118
raise CLIError("Invalid helm package name '{}'. Is it a '*.tgz' or '*.tgz.prov' file?".format(chart_package))
118119

119120
login_server, username, password = get_access_credentials(
@@ -130,7 +131,7 @@ def acr_helm_push(cmd,
130131
return request_data_from_registry(
131132
http_method='patch' if force else 'put',
132133
login_server=login_server,
133-
path=_get_blobs_path(repository, chart_package),
134+
path=_get_blobs_path(repository, chart_name),
134135
username=username,
135136
password=password,
136137
data_payload=input_file,

0 commit comments

Comments
 (0)