diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index e2b97761e0f..79b399496a8 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -11,11 +11,15 @@ To release a new version, please select a new version number (usually plus 1 to Pending +++++++ + +19.0.0b28 ++++++++ * Fix `match_condition` kwarg leaking to HTTP transport by overriding `put_mc` and `add_agentpool` to pass `if_match` / `if_none_match` directly to the vendored SDK. This change fixes the compatibility issue as azure-cli/acs module adopts TypeSpec emitted SDKs while azure-cli-extensions/aks-preview still uses the autorest emitted SDK. + `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region. * `az aks create/update`: Add `--enable-service-account-image-pull`, `--disable-service-account-image-pull`, and `--service-account-image-pull-default-managed-identity-id` parameters to manage service account based image pull settings. * `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region. * Add managed GPU enablement option to node pool property in `az aks nodepool add` and `az aks nodepool update`. +* `az aks namespace update`: Fix location should use existing namespace location. 19.0.0b27 +++++++ diff --git a/src/aks-preview/azext_aks_preview/managednamespace.py b/src/aks-preview/azext_aks_preview/managednamespace.py index 07e37bdf495..d4eae8c885a 100644 --- a/src/aks-preview/azext_aks_preview/managednamespace.py +++ b/src/aks-preview/azext_aks_preview/managednamespace.py @@ -201,7 +201,7 @@ def aks_managed_namespace_update(cmd, client, raw_parameters, headers, existedNa namespace_name = raw_parameters.get("name") namespace_config = updateNamespace(cmd, raw_parameters, existedNamespace) - namespace_config.location = get_cluster_location(cmd, resource_group_name, cluster_name) + namespace_config.location = existedNamespace.location return sdk_no_wait( no_wait, diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_managednamespace.py b/src/aks-preview/azext_aks_preview/tests/latest/test_managednamespace.py index e1b7b278b2c..61944c6e439 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_managednamespace.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_managednamespace.py @@ -287,6 +287,52 @@ def test_update_managed_namespace_with_invalid_delete_policy(self, mock_get_clie ns.aks_managed_namespace_update(cmd, None, raw_parameters, None, None, False) self.assertIn(err, str(cm.exception)) + def test_update_managed_namespace_sets_location_from_existing_namespace(self, mock_get_client): + register_aks_preview_resource_type() + cli_ctx = MockCLI() + cmd = MockCmd(cli_ctx) + + mock_client = Mock() + + existing_ns = Mock() + existing_ns.name = "test_managed_namespace" + existing_ns.location = "westus2" + existing_ns.properties.default_resource_quota.cpu_request = "300m" + existing_ns.properties.default_resource_quota.cpu_limit = "500m" + existing_ns.properties.default_resource_quota.memory_request = "1Gi" + existing_ns.properties.default_resource_quota.memory_limit = "2Gi" + existing_ns.properties.default_network_policy.ingress = "DenyAll" + existing_ns.properties.default_network_policy.egress = "AllowAll" + existing_ns.properties.adoption_policy = "Never" + existing_ns.properties.delete_policy = "Keep" + + raw_parameters = { + "resource_group_name": "test_rg", + "cluster_name": "test_cluster", + "name": "test_managed_namespace", + "tags": {}, + "labels": None, + "annotations": ["a=c"], + "cpu_request": None, + "cpu_limit": None, + "memory_request": None, + "memory_limit": None, + "ingress_policy": None, + "egress_policy": None, + "adoption_policy": None, + "delete_policy": None, + } + + ns.aks_managed_namespace_update(cmd, mock_client, raw_parameters, None, existing_ns, False) + + # The namespace passed to begin_create_or_update should carry the existing location + call_args = mock_client.begin_create_or_update.call_args + namespace_config = call_args[0][3] # 4th positional arg + self.assertEqual(namespace_config.location, "westus2") + + # No managed cluster GET should be needed for the update path + mock_get_client.assert_not_called() + if __name__ == "__main__": unittest.main() diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index ee7097e469c..2b7515ea68c 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -9,7 +9,7 @@ from setuptools import find_packages, setup -VERSION = "19.0.0b27" +VERSION = "19.0.0b28" CLASSIFIERS = [ "Development Status :: 4 - Beta",