diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index 4f203544cd7..2a217146e8d 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -11,6 +11,7 @@ To release a new version, please select a new version number (usually plus 1 to Pending +++++++ +* `az aks nodepool update`: clean up some useless code in the update managed gpu function. * `az aks machine add`: Add `--spot-max-price` flag support to set the max price (in US Dollars) you are willing to pay for spot instances on a machine. * `az aks machine add`: Add `--eviction-policy` flag support to set the eviction policy for a machine. * `az aks machine add`: Add `--enable-ultra-ssd` flag support to enable ultra ssd on a machine. diff --git a/src/aks-preview/azext_aks_preview/agentpool_decorator.py b/src/aks-preview/azext_aks_preview/agentpool_decorator.py index 517abe5a7b8..44791333787 100644 --- a/src/aks-preview/azext_aks_preview/agentpool_decorator.py +++ b/src/aks-preview/azext_aks_preview/agentpool_decorator.py @@ -1826,16 +1826,10 @@ def update_managed_gpu(self, agentpool: AgentPool) -> AgentPool: agentpool.gpu_profile = self.models.GPUProfile() # pylint: disable=no-member if agentpool.gpu_profile.nvidia is None: agentpool.gpu_profile.nvidia = self.models.NvidiaGPUProfile() # pylint: disable=no-member - # Check if already set to the desired value to avoid API error - if agentpool.gpu_profile.nvidia.management_mode == CONST_GPU_MANAGEMENT_MODE_MANAGED: - return agentpool agentpool.gpu_profile.nvidia.management_mode = CONST_GPU_MANAGEMENT_MODE_MANAGED agentpool.gpu_profile.driver = CONST_GPU_DRIVER_INSTALL else: if agentpool.gpu_profile and agentpool.gpu_profile.nvidia: - # Check if already set to the desired value to avoid API error - if agentpool.gpu_profile.nvidia.management_mode == CONST_GPU_MANAGEMENT_MODE_UNMANAGED: - return agentpool agentpool.gpu_profile.nvidia.management_mode = CONST_GPU_MANAGEMENT_MODE_UNMANAGED return agentpool