Skip to content

Commit

Permalink
{AKS} Fix the validators for options --min-count and --max-count (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
FumingZhang authored May 16, 2022
1 parent a026ed5 commit 697572b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
10 changes: 10 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

0.5.71
++++++

* Fix: Updated validators for options --min-count and --max-count to support specifying values greater than 100. Related commands are
* `az aks create`
* `az aks update`
* `az aks nodepool add`
* `az aks nodepool update`

0.5.70
++++++

* Fix: Don't update storageProfile if not set .

0.5.69
Expand Down
16 changes: 8 additions & 8 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@
long-summary: If specified, please make sure the kubernetes version is larger than 1.10.6.
- name: --min-count
type: int
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100].
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 1000].
- name: --max-count
type: int
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100].
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 1000].
- name: --cluster-autoscaler-profile
type: list
short-summary: Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile.
Expand Down Expand Up @@ -549,10 +549,10 @@
short-summary: Update min-count or max-count for cluster autoscaler.
- name: --min-count
type: int
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 1000]
- name: --max-count
type: int
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 1000]
- name: --uptime-sla
type: bool
short-summary: Enable a paid managed cluster service with a financially backed SLA.
Expand Down Expand Up @@ -1061,10 +1061,10 @@
short-summary: Enable cluster autoscaler.
- name: --min-count
type: int
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.
- name: --max-count
type: int
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.
- name: --scale-down-mode
type: string
short-summary: "Describes how VMs are added to or removed from nodepools."
Expand Down Expand Up @@ -1191,10 +1191,10 @@
short-summary: Update min-count or max-count for cluster autoscaler.
- name: --min-count
type: int
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]
short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.
- name: --max-count
type: int
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.
- name: --scale-down-mode
type: string
short-summary: "Describes how VMs are added to or removed from nodepools."
Expand Down
10 changes: 5 additions & 5 deletions src/aks-preview/azext_aks_preview/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ def validate_linux_host_name(namespace):


def validate_nodes_count(namespace):
"""Validate that min_count and max_count is set to 1-100"""
"""Validate that min_count and max_count is set to 0-1000"""
if namespace.min_count is not None:
if namespace.min_count < 1 or namespace.min_count > 100:
raise CLIError('--min-count must be in the range [1,100]')
if namespace.min_count < 0 or namespace.min_count > 1000:
raise CLIError('--min-count must be in the range [0,1000]')
if namespace.max_count is not None:
if namespace.max_count < 1 or namespace.max_count > 100:
raise CLIError('--max-count must be in the range [1,100]')
if namespace.max_count < 0 or namespace.max_count > 1000:
raise CLIError('--max-count must be in the range [0,1000]')


def validate_ip_ranges(namespace):
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.70"
VERSION = "0.5.71"
CLASSIFIERS = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down

0 comments on commit 697572b

Please sign in to comment.