From 4e10c77c6f213d831981dec7ec9016b6a28fb387 Mon Sep 17 00:00:00 2001 From: Andy Liu Date: Mon, 2 Mar 2020 23:46:22 +0800 Subject: [PATCH 1/3] add missing / in the dashboard url. --- src/azure-cli/azure/cli/command_modules/acs/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index 01531da9c5b..552559279d9 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -1550,7 +1550,7 @@ def aks_browse(cmd, client, resource_group_name, name, disable_browser=False, protocol = 'http' proxy_url = 'http://{0}:{1}/'.format(listen_address, listen_port) - dashboardURL = '{0}/api/v1/namespaces/kube-system/services/{1}:kubernetes-dashboard:/proxy'.format(proxy_url, + dashboardURL = '{0}/api/v1/namespaces/kube-system/services/{1}:kubernetes-dashboard:/proxy/'.format(proxy_url, protocol) # launch kubectl port-forward locally to access the remote dashboard if in_cloud_console(): From 3c1072dec49d9ba086c74e0acd8f6326b81861c7 Mon Sep 17 00:00:00 2001 From: Andy Liu Date: Wed, 4 Mar 2020 11:13:09 +0800 Subject: [PATCH 2/3] fix --- src/azure-cli/azure/cli/command_modules/acs/custom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index 552559279d9..c743127a32c 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -1551,17 +1551,17 @@ def aks_browse(cmd, client, resource_group_name, name, disable_browser=False, proxy_url = 'http://{0}:{1}/'.format(listen_address, listen_port) dashboardURL = '{0}/api/v1/namespaces/kube-system/services/{1}:kubernetes-dashboard:/proxy/'.format(proxy_url, - protocol) + protocol) # launch kubectl port-forward locally to access the remote dashboard if in_cloud_console(): # TODO: better error handling here. response = requests.post('http://localhost:8888/openport/{0}'.format(listen_port)) result = json.loads(response.text) - dashboardURL = '{0}api/v1/namespaces/kube-system/services/{1}:kubernetes-dashboard:/proxy'.format(result['url'], - protocol) + dashboardURL = '{0}api/v1/namespaces/kube-system/services/{1}:kubernetes-dashboard:/proxy/'.format(result['url'], + protocol) term_id = os.environ.get('ACC_TERM_ID') if term_id: - response = requests.post('http://localhost:8888/openLink/{}'.format(term_id), + response = requests.post('http://localhost:8888/openLink/{0}'.format(term_id), json={"url": dashboardURL}) logger.warning('To view the console, please open %s in a new tab', dashboardURL) else: From 4e9593f07b7fbc14ad01b602b4ba41b38dff12a6 Mon Sep 17 00:00:00 2001 From: Andy Liu Date: Wed, 4 Mar 2020 11:43:57 +0800 Subject: [PATCH 3/3] fix style. --- src/azure-cli/azure/cli/command_modules/acs/custom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index c743127a32c..cde819eba05 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -1557,8 +1557,8 @@ def aks_browse(cmd, client, resource_group_name, name, disable_browser=False, # TODO: better error handling here. response = requests.post('http://localhost:8888/openport/{0}'.format(listen_port)) result = json.loads(response.text) - dashboardURL = '{0}api/v1/namespaces/kube-system/services/{1}:kubernetes-dashboard:/proxy/'.format(result['url'], - protocol) + dashboardURL = '{0}api/v1/namespaces/kube-system/services/{1}:kubernetes-dashboard:/proxy/'.format( + result['url'], protocol) term_id = os.environ.get('ACC_TERM_ID') if term_id: response = requests.post('http://localhost:8888/openLink/{0}'.format(term_id),