From 8c74151c9b413b306cf3e60db6a3526ee3ebd42b Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Wed, 6 Apr 2022 16:58:38 +0800 Subject: [PATCH 1/4] keep aad profile in upgrade --- src/aks-preview/azext_aks_preview/custom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index 18d8b32048c..d109144f9c1 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -1282,9 +1282,8 @@ def aks_upgrade(cmd, # pylint: disable=unused-argument, too-many-return-state agent_profile.orchestrator_version = kubernetes_version agent_profile.creation_data = None - # null out the SP and AAD profile because otherwise validation complains + # null out the SP profile because otherwise validation complains instance.service_principal_profile = None - instance.aad_profile = None headers = get_aks_custom_headers(aks_custom_headers) From a6f20866bd59fdeab97c46cd4bed821218e1a2b7 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Wed, 6 Apr 2022 17:02:25 +0800 Subject: [PATCH 2/4] add new version --- src/aks-preview/HISTORY.md | 5 +++++ src/aks-preview/setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 644464b10f1..9b1947b7b76 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -3,6 +3,11 @@ Release History =============== +0.5.60 +++++++ + +* Fix `az aks upgrade`, keep aad profile in upgrade request. + 0.5.59 ++++++ diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index 53f75060d75..20197ef2bfb 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -9,7 +9,7 @@ from setuptools import setup, find_packages -VERSION = "0.5.59" +VERSION = "0.5.60" CLASSIFIERS = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", From 75b914e5eed7a69dd1b01d8cba59afad633740a0 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Thu, 7 Apr 2022 14:26:06 +0800 Subject: [PATCH 3/4] fix addon commands --- src/aks-preview/HISTORY.md | 5 ++++- src/aks-preview/azext_aks_preview/addonconfiguration.py | 3 +-- src/aks-preview/azext_aks_preview/custom.py | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 9b1947b7b76..37025a78423 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -6,7 +6,10 @@ Release History 0.5.60 ++++++ -* Fix `az aks upgrade`, keep aad profile in upgrade request. +* BugFix: Keep aad profile in PUT request of ManagedCluster. Modified commands are + * `az aks upgrade` + * `az aks enable-addons` + * `az aks addon enable` 0.5.59 ++++++ diff --git a/src/aks-preview/azext_aks_preview/addonconfiguration.py b/src/aks-preview/azext_aks_preview/addonconfiguration.py index dbea72aa124..9b6807010aa 100644 --- a/src/aks-preview/azext_aks_preview/addonconfiguration.py +++ b/src/aks-preview/azext_aks_preview/addonconfiguration.py @@ -270,9 +270,8 @@ def update_addons(cmd, # pylint: disable=too-many-branches,too-many-statements instance.addon_profiles = addon_profiles - # null out the SP and AAD profile because otherwise validation complains + # null out the SP profile because otherwise validation complains instance.service_principal_profile = None - instance.aad_profile = None return instance diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index d109144f9c1..463d4190b24 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -1191,9 +1191,8 @@ def aks_scale(cmd, # pylint: disable=unused-argument "Cannot scale cluster autoscaler enabled node pool.") agent_profile.count = int(node_count) # pylint: disable=no-member - # null out the SP and AAD profile because otherwise validation complains + # null out the SP profile because otherwise validation complains instance.service_principal_profile = None - instance.aad_profile = None return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, name, instance) raise CLIError('The nodepool "{}" was not found.'.format(nodepool_name)) @@ -2291,9 +2290,8 @@ def _update_addons(cmd, # pylint: disable=too-many-branches,too-many-statements instance.addon_profiles = addon_profiles - # null out the SP and AAD profile because otherwise validation complains + # null out the SP profile because otherwise validation complains instance.service_principal_profile = None - instance.aad_profile = None return instance From 9395a59c8b64797bebed9995e6d7bb70bb99059b Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Thu, 7 Apr 2022 14:50:40 +0800 Subject: [PATCH 4/4] update history --- src/aks-preview/HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 37025a78423..63e9033484e 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -7,9 +7,13 @@ Release History ++++++ * BugFix: Keep aad profile in PUT request of ManagedCluster. Modified commands are + * `az aks scale` * `az aks upgrade` * `az aks enable-addons` + * `az aks disable-addons` * `az aks addon enable` + * `az aks addon disable` + * `az aks addon update` 0.5.59 ++++++