Skip to content

Commit 2828d7e

Browse files
author
Hao Yuan
committed
rename to --managed-system-pool
1 parent 234e45b commit 2828d7e

File tree

8 files changed

+66
-62
lines changed

8 files changed

+66
-62
lines changed

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@
651651
- name: --vm-sizes
652652
type: string
653653
short-summary: Comma-separated list of sizes. Must use VirtualMachines agent pool type.
654-
- name: --enable-managed-system-pool
654+
- name: --managed-system-pool
655655
type: bool
656656
short-summary: Create a default ManagedSystem mode that is fully managed by AKS.
657657
long-summary: When set, the default system node pool is created with ManagedSystem mode, where all properties except name and mode are managed by AKS. Learn more at https://aka.ms/aks/nodepool/mode.
@@ -735,7 +735,7 @@
735735
- name: Create a kubernetes cluster with a VirtualMachines nodepool
736736
text: az aks create -g MyResourceGroup -n MyManagedCluster --vm-set-type VirtualMachines --vm-sizes "VMSize1,VMSize2" --node-count 3
737737
- name: Create a kubernetes cluster with a fully managed system node pool
738-
text: az aks create -g MyResourceGroup -n MyManagedCluster --enable-managed-system-pool
738+
text: az aks create -g MyResourceGroup -n MyManagedCluster --managed-system-pool
739739
740740
"""
741741

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ def load_arguments(self, _):
962962
# virtual machines
963963
c.argument("vm_sizes", is_preview=True)
964964
c.argument("enable_imds_restriction", action="store_true", is_preview=True)
965-
c.argument("enable_managed_system_pool", action="store_true", is_preview=True)
965+
c.argument("managed_system_pool", action="store_true", is_preview=True)
966966

967967
with self.argument_context("aks update") as c:
968968
# managed cluster paramerters

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ def aks_create(
733733
# IMDS restriction
734734
enable_imds_restriction=False,
735735
# managed system pool
736-
enable_managed_system_pool=False,
736+
managed_system_pool=False,
737737
):
738738
# DO NOT MOVE: get all the original parameters and save them as a dictionary
739739
raw_parameters = locals()

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,15 +1231,15 @@ def get_disable_image_integrity(self) -> bool:
12311231

12321232
return disable_image_integrity
12331233

1234-
def get_enable_managed_system_pool(self) -> bool:
1235-
"""Obtain the value of enable_managed_system_pool.
1234+
def get_managed_system_pool(self) -> bool:
1235+
"""Obtain the value of managed_system_pool.
12361236
12371237
:return: bool
12381238
"""
12391239
# read the original value passed by the command
1240-
enable_managed_system_pool = self.raw_param.get("enable_managed_system_pool")
1240+
managed_system_pool = self.raw_param.get("managed_system_pool")
12411241

1242-
return enable_managed_system_pool
1242+
return managed_system_pool
12431243

12441244
def get_cluster_snapshot_id(self) -> Union[str, None]:
12451245
"""Obtain the values of cluster_snapshot_id.
@@ -2923,9 +2923,9 @@ def init_agentpool_decorator_context(self) -> None:
29232923
29242924
:return: None
29252925
"""
2926-
# If enable_managed_system_pool is True, set the mode to ManagedSystem for the default nodepool
2926+
# If managed_system_pool is True, set the mode to ManagedSystem for the default nodepool
29272927
raw_parameters = self.__raw_parameters.copy()
2928-
if self.context.get_enable_managed_system_pool():
2928+
if self.context.get_managed_system_pool():
29292929
raw_parameters["mode"] = CONST_NODEPOOL_MODE_MANAGEDSYSTEM
29302930

29312931
self.agentpool_decorator = AKSPreviewAgentPoolAddDecorator(

src/aks-preview/azext_aks_preview/tests/latest/demo_enable_managed_system_pool.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env python
22
"""
3-
Demonstration script showing the --enable-managed-system-pool functionality
3+
Demonstration script showing the --managed-system-pool functionality
44
5-
This script demonstrates how the --enable-managed-system-pool flag works
5+
This script demonstrates how the --managed-system-pool flag works
66
by simulating the parameter flow through the AKS CLI extension.
77
8-
Usage: python demo_enable_managed_system_pool.py
8+
Usage: python demo_managed_system_pool.py
99
"""
1010

1111
import os
@@ -24,24 +24,24 @@
2424
AKSManagedClusterParamDict
2525

2626

27-
def demonstrate_enable_managed_system_pool():
28-
"""Demonstrate the enable_managed_system_pool functionality"""
27+
def demonstrate_managed_system_pool():
28+
"""Demonstrate the managed_system_pool functionality"""
2929

30-
print("🔧 AKS CLI Extension: --enable-managed-system-pool Demonstration")
31-
print("=" * 65)
30+
print("🔧 AKS CLI Extension: --managed-system-pool Demonstration")
31+
print("=" * 60)
3232

3333
# Mock command and models
3434
cmd = Mock()
3535
models = Mock()
3636

37-
print("\n📋 Scenario 1: User runs 'az aks create --enable-managed-system-pool'")
38-
print("-" * 65)
37+
print("\n📋 Scenario 1: User runs 'az aks create --managed-system-pool'")
38+
print("-" * 60)
3939

40-
# Simulate user parameters when --enable-managed-system-pool is used
40+
# Simulate user parameters when --managed-system-pool is used
4141
user_parameters = {
4242
"cluster_name": "my-aks-cluster",
4343
"resource_group": "my-rg",
44-
"enable_managed_system_pool": True,
44+
"managed_system_pool": True,
4545
"nodepool_name": "nodepool1",
4646
"node_vm_size": "Standard_D2s_v3",
4747
"node_count": 3,
@@ -58,22 +58,22 @@ def demonstrate_enable_managed_system_pool():
5858
)
5959

6060
# Check what the getter returns
61-
enable_managed_system_pool = ctx.get_enable_managed_system_pool()
62-
print(f"🔍 get_enable_managed_system_pool() returns: {enable_managed_system_pool}")
61+
managed_system_pool = ctx.get_managed_system_pool()
62+
print(f"🔍 get_managed_system_pool() returns: {managed_system_pool}")
6363

6464
# Simulate the parameter modification logic
6565
agentpool_parameters = user_parameters.copy()
66-
if enable_managed_system_pool:
66+
if managed_system_pool:
6767
agentpool_parameters["mode"] = CONST_NODEPOOL_MODE_MANAGEDSYSTEM
6868
print(f"✅ Mode set to: {CONST_NODEPOOL_MODE_MANAGEDSYSTEM}")
6969
else:
7070
print("❌ Mode not modified")
7171

7272
print(f"📤 Parameters passed to agentpool decorator: {agentpool_parameters}")
7373

74-
print("\n" + "=" * 65)
74+
print("\n" + "=" * 60)
7575
print("📋 Scenario 2: User runs 'az aks create' (without the flag)")
76-
print("-" * 65)
76+
print("-" * 60)
7777

7878
# Simulate user parameters without the flag
7979
user_parameters_without_flag = {
@@ -95,27 +95,27 @@ def demonstrate_enable_managed_system_pool():
9595
)
9696

9797
# Check what the getter returns
98-
enable_managed_system_pool2 = ctx2.get_enable_managed_system_pool()
99-
print(f"🔍 get_enable_managed_system_pool() returns: {enable_managed_system_pool2}")
98+
managed_system_pool2 = ctx2.get_managed_system_pool()
99+
print(f"🔍 get_managed_system_pool() returns: {managed_system_pool2}")
100100

101101
# Simulate the parameter modification logic
102102
agentpool_parameters2 = user_parameters_without_flag.copy()
103-
if enable_managed_system_pool2:
103+
if managed_system_pool2:
104104
agentpool_parameters2["mode"] = CONST_NODEPOOL_MODE_MANAGEDSYSTEM
105105
print(f"✅ Mode set to: {CONST_NODEPOOL_MODE_MANAGEDSYSTEM}")
106106
else:
107107
print("❌ Mode not modified (normal System mode will be used)")
108108

109109
print(f"📤 Parameters passed to agentpool decorator: {agentpool_parameters2}")
110110

111-
print("\n" + "=" * 65)
111+
print("\n" + "=" * 60)
112112
print("🎯 Summary")
113-
print("-" * 65)
114-
print("✅ When --enable-managed-system-pool is used:")
113+
print("-" * 60)
114+
print("✅ When --managed-system-pool is used:")
115115
print(" • The default system nodepool will be created in ManagedSystem mode")
116116
print(" • AKS fully manages the nodepool (users cannot modify it)")
117117
print(" • Provides a hands-off experience for system nodepools")
118-
print("\n❌ When --enable-managed-system-pool is NOT used:")
118+
print("\n❌ When --managed-system-pool is NOT used:")
119119
print(" • The default system nodepool will be created in normal System mode")
120120
print(" • Users can modify the nodepool as needed")
121121
print(" • Traditional AKS nodepool management applies")
@@ -130,4 +130,4 @@ def demonstrate_enable_managed_system_pool():
130130

131131

132132
if __name__ == "__main__":
133-
demonstrate_enable_managed_system_pool()
133+
demonstrate_managed_system_pool()

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,6 @@ def test_aks_byo_subnet_with_ingress_appgw_addon(
847847
"aks create --resource-group={resource_group} --name={aks_name} --enable-managed-identity "
848848
"--vnet-subnet-id {vnet_id}/subnets/aks-subnet -a ingress-appgw "
849849
"--appgw-name gateway --appgw-subnet-id {vnet_id}/subnets/appgw-subnet "
850-
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AppGatewayWithOverlayPreview "
851850
"--yes --ssh-key-value={ssh_key_value} -o json"
852851
)
853852
aks_cluster = self.cmd(
@@ -968,7 +967,6 @@ def test_aks_byo_appgw_with_ingress_appgw_addon(
968967
"aks create -n {aks_name} -g {resource_group} --enable-managed-identity "
969968
"--vnet-subnet-id {vnet_id}/subnets/aks-subnet "
970969
"-a ingress-appgw --appgw-id {appgw_id} --yes "
971-
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AppGatewayWithOverlayPreview "
972970
"--ssh-key-value={ssh_key_value} -o json"
973971
)
974972
aks_cluster = self.cmd(
@@ -15754,11 +15752,17 @@ def test_aks_network_isolated_cluster(self, resource_group, resource_group_locat
1575415752
"acr_id": acr_id,
1575515753
}
1575615754
)
15755+
# enable anonymous pull for ACR
15756+
update_acr_cmd = (
15757+
"acr update --resource-group {resource_group} --name {acr_name} "
15758+
"--anonymous-pull-enabled true -o json"
15759+
)
15760+
self.cmd(update_acr_cmd, checks=[self.check("provisioningState", "Succeeded")])
1575715761

1575815762
# enable acr artifact cache
1575915763
enable_acr_artifact_cache_cmd = (
15760-
"acr cache create -n aks-managed-mcr -r {acr_name} "
15761-
"--source-repo \"mcr.microsoft.com/*\" --target-repo \"aks-managed-repository/*\" -o json"
15764+
"acr cache create -n aks-mcr -r {acr_name} "
15765+
"--source-repo \"mcr.microsoft.com/*\" --target-repo \"*\" -o json"
1576215766
)
1576315767
self.cmd(enable_acr_artifact_cache_cmd, checks=[self.check("provisioningState", "Succeeded")])
1576415768

src/aks-preview/azext_aks_preview/tests/latest/test_enable_managed_system_pool.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,51 +16,51 @@
1616
AKSManagedClusterParamDict
1717

1818

19-
class EnableManagedSystemPoolTestCase(unittest.TestCase):
20-
"""Test cases for the --enable-managed-system-pool functionality"""
19+
class ManagedSystemPoolTestCase(unittest.TestCase):
20+
"""Test cases for the --managed-system-pool functionality"""
2121

2222
def setUp(self):
2323
"""Set up test fixtures"""
2424
self.cmd = Mock()
2525
self.client = Mock()
2626
self.models = Mock()
2727

28-
def test_get_enable_managed_system_pool_context(self):
29-
"""Test the get_enable_managed_system_pool method in AKSPreviewManagedClusterContext"""
28+
def test_get_managed_system_pool_context(self):
29+
"""Test the get_managed_system_pool method in AKSPreviewManagedClusterContext"""
3030

31-
# Test with enable_managed_system_pool=True
31+
# Test with managed_system_pool=True
3232
ctx1 = AKSPreviewManagedClusterContext(
3333
self.cmd,
34-
AKSManagedClusterParamDict({"enable_managed_system_pool": True}),
34+
AKSManagedClusterParamDict({"managed_system_pool": True}),
3535
self.models,
3636
decorator_mode=DecoratorMode.CREATE,
3737
)
38-
self.assertEqual(ctx1.get_enable_managed_system_pool(), True)
38+
self.assertEqual(ctx1.get_managed_system_pool(), True)
3939

40-
# Test with enable_managed_system_pool=False
40+
# Test with managed_system_pool=False
4141
ctx2 = AKSPreviewManagedClusterContext(
4242
self.cmd,
43-
AKSManagedClusterParamDict({"enable_managed_system_pool": False}),
43+
AKSManagedClusterParamDict({"managed_system_pool": False}),
4444
self.models,
4545
decorator_mode=DecoratorMode.CREATE,
4646
)
47-
self.assertEqual(ctx2.get_enable_managed_system_pool(), False)
47+
self.assertEqual(ctx2.get_managed_system_pool(), False)
4848

49-
# Test with enable_managed_system_pool=None (default)
49+
# Test with managed_system_pool=None (default)
5050
ctx3 = AKSPreviewManagedClusterContext(
5151
self.cmd,
5252
AKSManagedClusterParamDict({}),
5353
self.models,
5454
decorator_mode=DecoratorMode.CREATE,
5555
)
56-
self.assertEqual(ctx3.get_enable_managed_system_pool(), None)
56+
self.assertEqual(ctx3.get_managed_system_pool(), None)
5757

5858
def test_raw_parameter_modification_logic(self):
5959
"""Test the parameter modification logic that sets mode to ManagedSystem"""
6060

61-
# Test with enable_managed_system_pool=True
61+
# Test with managed_system_pool=True
6262
raw_parameters_true = {
63-
"enable_managed_system_pool": True,
63+
"managed_system_pool": True,
6464
"nodepool_name": "test_np_name",
6565
"node_vm_size": "Standard_D2s_v3",
6666
}
@@ -74,15 +74,15 @@ def test_raw_parameter_modification_logic(self):
7474

7575
# Simulate the logic from init_agentpool_decorator_context
7676
modified_raw_parameters = raw_parameters_true.copy()
77-
if ctx_true.get_enable_managed_system_pool():
77+
if ctx_true.get_managed_system_pool():
7878
modified_raw_parameters["mode"] = CONST_NODEPOOL_MODE_MANAGEDSYSTEM
7979

8080
# Verify the mode was set
8181
self.assertEqual(modified_raw_parameters.get("mode"), CONST_NODEPOOL_MODE_MANAGEDSYSTEM)
8282

83-
# Test with enable_managed_system_pool=False
83+
# Test with managed_system_pool=False
8484
raw_parameters_false = {
85-
"enable_managed_system_pool": False,
85+
"managed_system_pool": False,
8686
"nodepool_name": "test_np_name",
8787
}
8888

@@ -95,7 +95,7 @@ def test_raw_parameter_modification_logic(self):
9595

9696
# Simulate the logic from init_agentpool_decorator_context
9797
modified_raw_parameters_false = raw_parameters_false.copy()
98-
if ctx_false.get_enable_managed_system_pool():
98+
if ctx_false.get_managed_system_pool():
9999
modified_raw_parameters_false["mode"] = CONST_NODEPOOL_MODE_MANAGEDSYSTEM
100100

101101
# Verify the mode was NOT set

src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,33 +215,33 @@ def test_get_addon_consts(self):
215215
}
216216
self.assertEqual(addon_consts, ground_truth_addon_consts)
217217

218-
def test_get_enable_managed_system_pool(self):
218+
def test_get_managed_system_pool(self):
219219
# default - parameter not specified
220220
ctx_1 = AKSPreviewManagedClusterContext(
221221
self.cmd,
222222
AKSManagedClusterParamDict({}),
223223
self.models,
224224
decorator_mode=DecoratorMode.CREATE,
225225
)
226-
self.assertEqual(ctx_1.get_enable_managed_system_pool(), None)
226+
self.assertEqual(ctx_1.get_managed_system_pool(), None)
227227

228228
# enabled
229229
ctx_2 = AKSPreviewManagedClusterContext(
230230
self.cmd,
231-
AKSManagedClusterParamDict({"enable_managed_system_pool": True}),
231+
AKSManagedClusterParamDict({"managed_system_pool": True}),
232232
self.models,
233233
decorator_mode=DecoratorMode.CREATE,
234234
)
235-
self.assertEqual(ctx_2.get_enable_managed_system_pool(), True)
235+
self.assertEqual(ctx_2.get_managed_system_pool(), True)
236236

237237
# disabled
238238
ctx_3 = AKSPreviewManagedClusterContext(
239239
self.cmd,
240-
AKSManagedClusterParamDict({"enable_managed_system_pool": False}),
240+
AKSManagedClusterParamDict({"managed_system_pool": False}),
241241
self.models,
242242
decorator_mode=DecoratorMode.CREATE,
243243
)
244-
self.assertEqual(ctx_3.get_enable_managed_system_pool(), False)
244+
self.assertEqual(ctx_3.get_managed_system_pool(), False)
245245

246246
def test_get_http_proxy_config(self):
247247
# default

0 commit comments

Comments
 (0)