Skip to content

Commit 7e1170c

Browse files
committed
feat: add AzureLinuxOSGuard and AzureLinux3OSGuard as valid OSSKU for create/migrate
1 parent bd9c96f commit 7e1170c

3 files changed

Lines changed: 80 additions & 0 deletions

File tree

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
CONST_OS_SKU_AZURELINUX3 = "AzureLinux3"
4242
CONST_OS_SKU_UBUNTU2204 = "Ubuntu2204"
4343
CONST_OS_SKU_UBUNTU2404 = "Ubuntu2404"
44+
CONST_OS_SKU_AZURELINUXOSGUARD = "AzureLinuxOSGuard"
45+
CONST_OS_SKU_AZURELINUX3OSGUARD = "AzureLinux3OSGuard"
4446

4547
# vm set type
4648
CONST_VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets"

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
CONST_OS_SKU_AZURELINUX3,
9696
CONST_OS_SKU_CBLMARINER,
9797
CONST_OS_SKU_MARINER,
98+
CONST_OS_SKU_AZURELINUXOSGUARD,
99+
CONST_OS_SKU_AZURELINUX3OSGUARD,
98100
CONST_OS_SKU_UBUNTU,
99101
CONST_OS_SKU_UBUNTU2204,
100102
CONST_OS_SKU_UBUNTU2404,
@@ -277,6 +279,8 @@
277279
CONST_OS_SKU_MARINER,
278280
CONST_OS_SKU_UBUNTU2204,
279281
CONST_OS_SKU_UBUNTU2404,
282+
CONST_OS_SKU_AZURELINUXOSGUARD,
283+
CONST_OS_SKU_AZURELINUX3OSGUARD,
280284
]
281285
node_os_skus = node_os_skus_create + [
282286
CONST_OS_SKU_WINDOWS2019,
@@ -289,6 +293,8 @@
289293
CONST_OS_SKU_UBUNTU,
290294
CONST_OS_SKU_UBUNTU2204,
291295
CONST_OS_SKU_UBUNTU2404,
296+
CONST_OS_SKU_AZURELINUXOSGUARD,
297+
CONST_OS_SKU_AZURELINUX3OSGUARD,
292298
]
293299
scale_down_modes = [CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE]
294300
workload_runtimes = [

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

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,6 +2960,78 @@ def test_aks_nodepool_add_with_ossku_azurelinux3(self, resource_group, resource_
29602960
self.cmd(
29612961
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
29622962

2963+
@AllowLargeResponse()
2964+
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus')
2965+
def test_aks_nodepool_add_with_ossku_azurelinuxosguard(self, resource_group, resource_group_location):
2966+
aks_name = self.create_random_name('cliakstest', 16)
2967+
node_pool_name = self.create_random_name('c', 6)
2968+
node_pool_name_second = self.create_random_name('c', 6)
2969+
self.kwargs.update({
2970+
'resource_group': resource_group,
2971+
'name': aks_name,
2972+
'node_pool_name': node_pool_name,
2973+
'node_pool_name_second': node_pool_name_second,
2974+
'ssh_key_value': self.generate_ssh_keys()
2975+
})
2976+
2977+
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
2978+
'--nodepool-name {node_pool_name} -c 1 ' \
2979+
'--ssh-key-value={ssh_key_value}'
2980+
self.cmd(create_cmd, checks=[
2981+
self.check('provisioningState', 'Succeeded'),
2982+
])
2983+
2984+
# nodepool get-upgrades
2985+
self.cmd('aks nodepool add '
2986+
'--resource-group={resource_group} '
2987+
'--cluster-name={name} '
2988+
'--name={node_pool_name_second} '
2989+
'--os-sku AzureLinuxOSGuard',
2990+
checks=[
2991+
self.check('provisioningState', 'Succeeded'),
2992+
self.check('osSku', 'AzureLinuxOSGuard'),
2993+
])
2994+
2995+
# delete
2996+
self.cmd(
2997+
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
2998+
2999+
@AllowLargeResponse()
3000+
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus')
3001+
def test_aks_nodepool_add_with_ossku_azurelinux3osguard(self, resource_group, resource_group_location):
3002+
aks_name = self.create_random_name('cliakstest', 16)
3003+
node_pool_name = self.create_random_name('c', 6)
3004+
node_pool_name_second = self.create_random_name('c', 6)
3005+
self.kwargs.update({
3006+
'resource_group': resource_group,
3007+
'name': aks_name,
3008+
'node_pool_name': node_pool_name,
3009+
'node_pool_name_second': node_pool_name_second,
3010+
'ssh_key_value': self.generate_ssh_keys()
3011+
})
3012+
3013+
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
3014+
'--nodepool-name {node_pool_name} -c 1 ' \
3015+
'--ssh-key-value={ssh_key_value}'
3016+
self.cmd(create_cmd, checks=[
3017+
self.check('provisioningState', 'Succeeded'),
3018+
])
3019+
3020+
# nodepool get-upgrades
3021+
self.cmd('aks nodepool add '
3022+
'--resource-group={resource_group} '
3023+
'--cluster-name={name} '
3024+
'--name={node_pool_name_second} '
3025+
'--os-sku AzureLinux3OSGuard',
3026+
checks=[
3027+
self.check('provisioningState', 'Succeeded'),
3028+
self.check('osSku', 'AzureLinux3OSGuard'),
3029+
])
3030+
3031+
# delete
3032+
self.cmd(
3033+
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
3034+
29633035
@AllowLargeResponse()
29643036
@AKSCustomResourceGroupPreparer(
29653037
random_name_length=17, name_prefix="clitest", location="westus2"

0 commit comments

Comments
 (0)