Skip to content

Commit

Permalink
fix (#4810)
Browse files Browse the repository at this point in the history
  • Loading branch information
FumingZhang authored May 13, 2022
1 parent fd77f65 commit 91285ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
4 changes: 4 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

0.5.69
++++++
* Fix: Raise error when user provides invalid value for `--os-sku`.

0.5.68
++++++
* Add option `Windows2019`, `Windows2022` to `--os-sku` for `az aks nodepool add`.
Expand Down
21 changes: 0 additions & 21 deletions src/aks-preview/azext_aks_preview/_completers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@

from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW

from ._consts import (
CONST_OS_SKU_UBUNTU,
CONST_OS_SKU_CBLMARINER,
CONST_OS_SKU_WINDOWS2019,
CONST_OS_SKU_WINDOWS2022,
)


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


@Completer
def get_cluster_ossku_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument
"""Return the list of allowed os-sku values when create cluster"""

return [CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER]


@Completer
def get_nodepool_ossku_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument
"""Return the list of allowed os-sku values when add nodepool"""

return [CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_WINDOWS2019, CONST_OS_SKU_WINDOWS2022]


def _get_location(cli_ctx, namespace):
"""
Return an Azure location by using an explicit `--location` argument, then by `--resource-group`, and
Expand Down
7 changes: 2 additions & 5 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
from ._completers import (
get_k8s_upgrades_completion_list,
get_k8s_versions_completion_list,
get_cluster_ossku_completion_list,
get_nodepool_ossku_completion_list,
get_vm_size_completion_list,
)
from ._consts import (
Expand Down Expand Up @@ -246,7 +244,7 @@ def load_arguments(self, _):
help='Node pool name, upto 12 alphanumeric characters', validator=validate_nodepool_name)
c.argument('node_vm_size', options_list=[
'--node-vm-size', '-s'], completer=get_vm_size_completion_list)
c.argument('os_sku', completer=get_cluster_ossku_completion_list)
c.argument('os_sku', arg_type=get_enum_type(node_os_skus))
c.argument('vnet_subnet_id', validator=validate_vnet_subnet_id)
c.argument('pod_subnet_id', validator=validate_pod_subnet_id)
c.argument('enable_node_public_ip', action='store_true')
Expand Down Expand Up @@ -413,8 +411,7 @@ def load_arguments(self, _):
c.argument('node_vm_size', options_list=[
'--node-vm-size', '-s'], completer=get_vm_size_completion_list)
c.argument('os_type')
c.argument('os_sku', options_list=[
'--os-sku'], completer=get_nodepool_ossku_completion_list)
c.argument('os_sku', arg_type=get_enum_type(node_os_skus))
c.argument('vnet_subnet_id',
validator=validate_vnet_subnet_id)
c.argument('pod_subnet_id',
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.68"
VERSION = "0.5.69"
CLASSIFIERS = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down

0 comments on commit 91285ad

Please sign in to comment.