Skip to content

Commit

Permalink
Removed tags parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Anumita committed Aug 6, 2020
1 parent c0c8ca1 commit 5770e67
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/connectedk8s/azext_connectedk8s/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def load_arguments(self, _):

with self.argument_context('connectedk8s update') as c:
c.argument('cluster_name', options_list=['--name', '-n'], id_part='name', help='The name of the connected cluster.')
c.argument('tags', tags_type)
c.argument('kube_config', options_list=['--kube-config'], help='Path to the kube config file.')
c.argument('kube_context', options_list=['--kube-context'], help='Kubconfig context from current machine.')
c.argument('https_proxy', options_list=['--proxy-https'], help='Https proxy URL to be used.')
Expand Down
23 changes: 11 additions & 12 deletions src/connectedk8s/azext_connectedk8s/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,17 @@ def export_helm_chart(registry_path, chart_export_path, kube_config, kube_contex


def add_helm_repo(kube_config, kube_context):
if os.getenv('HELMREPONAME') and os.getenv('HELMREPOURL'):
repo_name = os.getenv('HELMREPONAME')
repo_url = os.getenv('HELMREPOURL')
cmd_helm_repo = ["helm", "repo", "add", repo_name, repo_url, "--kubeconfig", kube_config]
if kube_context:
cmd_helm_repo.extend(["--kube-context", kube_context])
response_helm_repo = Popen(cmd_helm_repo, stdout=PIPE, stderr=PIPE)
_, error_helm_repo = response_helm_repo.communicate()
if response_helm_repo.returncode != 0:
telemetry.set_exception(exception=error_helm_repo.decode("ascii"), fault_type=consts.Add_HelmRepo_Fault_Type,
summary='Failed to add helm repository')
raise CLIError("Unable to add repository {} to helm: ".format(repo_url) + error_helm_repo.decode("ascii"))
repo_name = os.getenv('HELMREPONAME')
repo_url = os.getenv('HELMREPOURL')
cmd_helm_repo = ["helm", "repo", "add", repo_name, repo_url, "--kubeconfig", kube_config]
if kube_context:
cmd_helm_repo.extend(["--kube-context", kube_context])
response_helm_repo = Popen(cmd_helm_repo, stdout=PIPE, stderr=PIPE)
_, error_helm_repo = response_helm_repo.communicate()
if response_helm_repo.returncode != 0:
telemetry.set_exception(exception=error_helm_repo.decode("ascii"), fault_type=consts.Add_HelmRepo_Fault_Type,
summary='Failed to add helm repository')
raise CLIError("Unable to add repository {} to helm: ".format(repo_url) + error_helm_repo.decode("ascii"))


def get_helm_registry(profile, location):
Expand Down
2 changes: 1 addition & 1 deletion src/connectedk8s/azext_connectedk8s/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def load_command_table(self, _):

with self.command_group('connectedk8s', connectedk8s_sdk, client_factory=cf_connected_cluster) as g:
g.custom_command('connect', 'create_connectedk8s', supports_no_wait=True)
g.custom_command('update', 'update_agents', supports_no_wait=True)
g.custom_command('update', 'update_agents')
g.custom_command('delete', 'delete_connectedk8s', confirmation=True, supports_no_wait=True)
g.custom_command('list', 'list_connectedk8s', table_transformer=connectedk8s_list_table_format)
g.custom_show_command('show', 'get_connectedk8s', table_transformer=connectedk8s_show_table_format)
Expand Down
6 changes: 4 additions & 2 deletions src/connectedk8s/azext_connectedk8s/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, https_pr
raise CLIError("Failed to create the resource group {} :".format(resource_group_name) + str(e))

# Adding helm repo
utils.add_helm_repo(kube_config, kube_context)
if os.getenv('HELMREPONAME') and os.getenv('HELMREPOURL'):
utils.add_helm_repo(kube_config, kube_context)

# Retrieving Helm chart OCI Artifact location
registry_path = os.getenv('HELMREGISTRY') if os.getenv('HELMREGISTRY') else utils.get_helm_registry(profile, location)
Expand Down Expand Up @@ -664,7 +665,8 @@ def update_agents(cmd, client, resource_group_name, cluster_name, https_proxy=""
connected_cluster = get_connectedk8s(cmd, client, resource_group_name, cluster_name)

# Adding helm repo
utils.add_helm_repo(kube_config, kube_context)
if os.getenv('HELMREPONAME') and os.getenv('HELMREPOURL'):
utils.add_helm_repo(kube_config, kube_context)

# Retrieving Helm chart OCI Artifact location
registry_path = os.getenv('HELMREGISTRY') if os.getenv('HELMREGISTRY') else utils.get_helm_registry(profile, connected_cluster.location)
Expand Down

0 comments on commit 5770e67

Please sign in to comment.