diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index 99f8dedb247..f3f3a92b2b5 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -12,6 +12,11 @@ To release a new version, please select a new version number (usually plus 1 to Pending +++++++ +0.5.114 ++++++++ + +* Fix `az aks create` and `az aks nodepool add` commands failing on adding nodepool with managed ApplicationSecurityGroups. + 0.5.113 +++++++ diff --git a/src/aks-preview/azext_aks_preview/agentpool_decorator.py b/src/aks-preview/azext_aks_preview/agentpool_decorator.py index ff82f67a4c4..2869eea8330 100644 --- a/src/aks-preview/azext_aks_preview/agentpool_decorator.py +++ b/src/aks-preview/azext_aks_preview/agentpool_decorator.py @@ -402,11 +402,10 @@ def set_up_agentpool_network_profile(self, agentpool: AgentPool) -> AgentPool: asg_ids = self.context.get_asg_ids() allowed_host_ports = self.context.get_allowed_host_ports() - if asg_ids and allowed_host_ports: - agentpool.network_profile = self.models.AgentPoolNetworkProfile( - application_security_groups=asg_ids, - allowed_host_ports=allowed_host_ports, - ) + agentpool.network_profile = self.models.AgentPoolNetworkProfile() + if allowed_host_ports is not None: + agentpool.network_profile.allowed_host_ports = allowed_host_ports + agentpool.network_profile.application_security_groups = asg_ids return agentpool def construct_agentpool_profile_preview(self) -> AgentPool: diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py b/src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py index c48078091b1..1f5be78e186 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py @@ -537,6 +537,7 @@ def test_construct_agentpool_profile_preview(self): scale_down_mode=CONST_SCALE_DOWN_MODE_DELETE, workload_runtime=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, enable_custom_ca_trust=False, + network_profile=self.models.AgentPoolNetworkProfile(), ) self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) @@ -629,6 +630,7 @@ def test_construct_agentpool_profile_preview(self): mode=CONST_NODEPOOL_MODE_SYSTEM, workload_runtime=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, enable_custom_ca_trust=False, + network_profile=self.models.AgentPoolNetworkProfile(), ) self.assertEqual(dec_agentpool_1, ground_truth_agentpool_1) diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py b/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py index bbdeb256e5d..152a1b59684 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py @@ -3410,6 +3410,7 @@ def test_set_up_agentpool_profile(self): message_of_the_day="W10=", # base64 encode of "[]" gpu_instance_profile="test_gpu_instance_profile", workload_runtime=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, + network_profile=self.models.AgentPoolNetworkProfile(), ) ground_truth_mc_1 = self.models.ManagedCluster(location="test_location") ground_truth_mc_1.agent_pool_profiles = [ground_truth_agentpool_profile_1] @@ -4234,6 +4235,7 @@ def test_construct_mc_profile_preview(self): mode=CONST_NODEPOOL_MODE_SYSTEM, workload_runtime=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER, enable_custom_ca_trust=False, + network_profile=self.models.AgentPoolNetworkProfile(), ) ssh_config_1 = self.models.ContainerServiceSshConfiguration( public_keys=[self.models.ContainerServiceSshPublicKey(key_data=public_key)] diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index 9898c42a8fb..a6fe608aed8 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.113" +VERSION = "0.5.114" CLASSIFIERS = [ "Development Status :: 4 - Beta",