Skip to content

Commit 91285ad

Browse files
authored
fix (#4810)
1 parent fd77f65 commit 91285ad

File tree

4 files changed

+7
-27
lines changed

4 files changed

+7
-27
lines changed

src/aks-preview/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414

15+
0.5.69
16+
++++++
17+
* Fix: Raise error when user provides invalid value for `--os-sku`.
18+
1519
0.5.68
1620
++++++
1721
* Add option `Windows2019`, `Windows2022` to `--os-sku` for `az aks nodepool add`.

src/aks-preview/azext_aks_preview/_completers.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88

99
from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW
1010

11-
from ._consts import (
12-
CONST_OS_SKU_UBUNTU,
13-
CONST_OS_SKU_CBLMARINER,
14-
CONST_OS_SKU_WINDOWS2019,
15-
CONST_OS_SKU_WINDOWS2022,
16-
)
17-
1811

1912
@Completer
2013
def get_k8s_upgrades_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument
@@ -69,20 +62,6 @@ def get_vm_sizes(cli_ctx, location):
6962
return cf_compute_service(cli_ctx).virtual_machine_sizes.list(location)
7063

7164

72-
@Completer
73-
def get_cluster_ossku_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument
74-
"""Return the list of allowed os-sku values when create cluster"""
75-
76-
return [CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER]
77-
78-
79-
@Completer
80-
def get_nodepool_ossku_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument
81-
"""Return the list of allowed os-sku values when add nodepool"""
82-
83-
return [CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_WINDOWS2019, CONST_OS_SKU_WINDOWS2022]
84-
85-
8665
def _get_location(cli_ctx, namespace):
8766
"""
8867
Return an Azure location by using an explicit `--location` argument, then by `--resource-group`, and

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
from ._completers import (
2525
get_k8s_upgrades_completion_list,
2626
get_k8s_versions_completion_list,
27-
get_cluster_ossku_completion_list,
28-
get_nodepool_ossku_completion_list,
2927
get_vm_size_completion_list,
3028
)
3129
from ._consts import (
@@ -246,7 +244,7 @@ def load_arguments(self, _):
246244
help='Node pool name, upto 12 alphanumeric characters', validator=validate_nodepool_name)
247245
c.argument('node_vm_size', options_list=[
248246
'--node-vm-size', '-s'], completer=get_vm_size_completion_list)
249-
c.argument('os_sku', completer=get_cluster_ossku_completion_list)
247+
c.argument('os_sku', arg_type=get_enum_type(node_os_skus))
250248
c.argument('vnet_subnet_id', validator=validate_vnet_subnet_id)
251249
c.argument('pod_subnet_id', validator=validate_pod_subnet_id)
252250
c.argument('enable_node_public_ip', action='store_true')
@@ -413,8 +411,7 @@ def load_arguments(self, _):
413411
c.argument('node_vm_size', options_list=[
414412
'--node-vm-size', '-s'], completer=get_vm_size_completion_list)
415413
c.argument('os_type')
416-
c.argument('os_sku', options_list=[
417-
'--os-sku'], completer=get_nodepool_ossku_completion_list)
414+
c.argument('os_sku', arg_type=get_enum_type(node_os_skus))
418415
c.argument('vnet_subnet_id',
419416
validator=validate_vnet_subnet_id)
420417
c.argument('pod_subnet_id',

src/aks-preview/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from setuptools import setup, find_packages
1111

12-
VERSION = "0.5.68"
12+
VERSION = "0.5.69"
1313
CLASSIFIERS = [
1414
"Development Status :: 4 - Beta",
1515
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)