Skip to content

Commit

Permalink
[AKS] Fix NSG Control flags when creating agentpool (#5520)
Browse files Browse the repository at this point in the history
* Fix asg-ids / allowed-hostports flags when creating agentpool

* Fix ut
  • Loading branch information
zarvd authored Nov 7, 2022
1 parent cc73c6c commit f5fb41b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
+++++++

Expand Down
9 changes: 4 additions & 5 deletions src/aks-preview/azext_aks_preview/agentpool_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from setuptools import setup, find_packages

VERSION = "0.5.113"
VERSION = "0.5.114"

CLASSIFIERS = [
"Development Status :: 4 - Beta",
Expand Down

0 comments on commit f5fb41b

Please sign in to comment.