Skip to content

Commit 77eb43d

Browse files
committed
[AKS] az aks nodepool add/update: Add option Ubuntu2404 to --os-sku parameter
1 parent 9f3aac4 commit 77eb43d

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

src/azure-cli/azure/cli/command_modules/acs/_consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
CONST_OS_SKU_AZURELINUX = "AzureLinux"
4040
CONST_OS_SKU_AZURELINUX3 = "AzureLinux3"
4141
CONST_OS_SKU_UBUNTU2204 = "Ubuntu2204"
42+
CONST_OS_SKU_UBUNTU2404 = "Ubuntu2404"
4243

4344
# vm set type
4445
CONST_VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets"

src/azure-cli/azure/cli/command_modules/acs/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@
16911691
short-summary: The OS Type. Linux or Windows.
16921692
- name: --os-sku
16931693
type: string
1694-
short-summary: The OS SKU of the agent node pool. Ubuntu, Ubuntu2204, AzureLinux or AzureLinux3 for Linux. Windows2019 or Windows2022 for Windows.
1694+
short-summary: The OS SKU of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, AzureLinux or AzureLinux3 for Linux. Windows2019 or Windows2022 for Windows.
16951695
- name: --enable-cluster-autoscaler -e
16961696
type: bool
16971697
short-summary: Enable cluster autoscaler.

src/azure-cli/azure/cli/command_modules/acs/_params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
CONST_OS_DISK_TYPE_EPHEMERAL, CONST_OS_DISK_TYPE_MANAGED,
3434
CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3,
3535
CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_MARINER,
36-
CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204,
36+
CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404,
3737
CONST_OS_SKU_WINDOWS2019, CONST_OS_SKU_WINDOWS2022,
3838
CONST_OUTBOUND_TYPE_LOAD_BALANCER, CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
3939
CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY,
@@ -169,9 +169,9 @@
169169
node_eviction_policies = [CONST_SPOT_EVICTION_POLICY_DELETE, CONST_SPOT_EVICTION_POLICY_DEALLOCATE]
170170
node_os_disk_types = [CONST_OS_DISK_TYPE_MANAGED, CONST_OS_DISK_TYPE_EPHEMERAL]
171171
node_mode_types = [CONST_NODEPOOL_MODE_SYSTEM, CONST_NODEPOOL_MODE_USER, CONST_NODEPOOL_MODE_GATEWAY]
172-
node_os_skus_create = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_MARINER, CONST_OS_SKU_UBUNTU2204]
172+
node_os_skus_create = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_MARINER, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404]
173173
node_os_skus = node_os_skus_create + [CONST_OS_SKU_WINDOWS2019, CONST_OS_SKU_WINDOWS2022]
174-
node_os_skus_update = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204]
174+
node_os_skus_update = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404]
175175
scale_down_modes = [CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE]
176176
pod_ip_allocation_modes = [CONST_NETWORK_POD_IP_ALLOCATION_MODE_DYNAMIC_INDIVIDUAL, CONST_NETWORK_POD_IP_ALLOCATION_MODE_STATIC_BLOCK]
177177

src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,6 +3331,43 @@ def test_aks_nodepool_add_with_ossku_ubuntu2204(self, resource_group, resource_g
33313331
self.cmd(
33323332
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
33333333

3334+
@AllowLargeResponse()
3335+
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus2euap')
3336+
def test_aks_nodepool_add_with_ossku_ubuntu2404(self, resource_group, resource_group_location):
3337+
resource_group_location = 'eastus2euap'
3338+
aks_name = self.create_random_name('cliakstest', 16)
3339+
node_pool_name = self.create_random_name('c', 6)
3340+
node_pool_name_second = self.create_random_name('c', 6)
3341+
self.kwargs.update({
3342+
'resource_group': resource_group,
3343+
'name': aks_name,
3344+
'node_pool_name': node_pool_name,
3345+
'node_pool_name_second': node_pool_name_second,
3346+
'ssh_key_value': self.generate_ssh_keys()
3347+
})
3348+
3349+
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
3350+
'--nodepool-name {node_pool_name} -c 1 ' \
3351+
'--ssh-key-value={ssh_key_value}'
3352+
self.cmd(create_cmd, checks=[
3353+
self.check('provisioningState', 'Succeeded'),
3354+
])
3355+
3356+
# nodepool get-upgrades
3357+
self.cmd('aks nodepool add '
3358+
'--resource-group={resource_group} '
3359+
'--cluster-name={name} '
3360+
'--name={node_pool_name_second} '
3361+
'--os-sku Ubuntu2404',
3362+
checks=[
3363+
self.check('provisioningState', 'Succeeded'),
3364+
self.check('osSku', 'Ubuntu2404'),
3365+
])
3366+
3367+
# delete
3368+
self.cmd(
3369+
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
3370+
33343371
@AllowLargeResponse()
33353372
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus2euap')
33363373
def test_aks_nodepool_add_with_ossku_azurelinux3(self, resource_group, resource_group_location):

0 commit comments

Comments
 (0)