From f89dbf4b196ea4f33b75b7f1bcc5deb251fb4057 Mon Sep 17 00:00:00 2001 From: Matt Boersma Date: Fri, 2 Feb 2018 14:53:40 -0800 Subject: [PATCH] [AKS] fix `az aks browse` if dashboard isn't prefixed by "pods/" (#5462) * [AKS] fix `az aks browse` if dashboard isn't prefixed by "pods/" * Update HISTORY.rst --- src/command_modules/azure-cli-acs/HISTORY.rst | 1 + .../azure-cli-acs/azure/cli/command_modules/acs/custom.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/command_modules/azure-cli-acs/HISTORY.rst b/src/command_modules/azure-cli-acs/HISTORY.rst index 7983b92fe39..29ffc420934 100644 --- a/src/command_modules/azure-cli-acs/HISTORY.rst +++ b/src/command_modules/azure-cli-acs/HISTORY.rst @@ -6,6 +6,7 @@ Release History 2.0.26 ++++++ * `aks create` VM node size default changed from "Standard_D1_v2" to "Standard_DS1_v2" +* improve reliability when locating the dashboard pod for `az aks browse` 2.0.25 ++++++ diff --git a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py index e333ee5bf24..06dde8a9b03 100644 --- a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py +++ b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py @@ -1236,8 +1236,8 @@ def aks_browse(cmd, client, resource_group_name, name, disable_browser=False): except subprocess.CalledProcessError as err: raise CLIError('Could not find dashboard pod: {}'.format(err)) if dashboard_pod: - # remove the "pods/" prefix from the name - dashboard_pod = str(dashboard_pod)[5:].strip() + # remove any "pods/" or "pod/" prefix from the name + dashboard_pod = str(dashboard_pod).split('/')[-1].strip() else: raise CLIError("Couldn't find the Kubernetes dashboard pod.") # launch kubectl port-forward locally to access the remote dashboard