Skip to content

Commit

Permalink
[AKS] remove k8s default version from CLI (Azure#5456)
Browse files Browse the repository at this point in the history
* [AKS] remove k8s default version from CLI

This allows the RP to set the default version if the user doesn't
supply one explicitly.

* Update HISTORY.rst for new `az aks create` default version behavior

* Fix some errant indentation.
  • Loading branch information
mboersma authored and Lukasz Stempniewicz committed Feb 21, 2018
1 parent f89dbf4 commit 7b9e6fb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/command_modules/azure-cli-acs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release History

2.0.26
++++++
* `aks create` defaults to letting the server choose the version of Kubernetes
* `aks create` VM node size default changed from "Standard_D1_v2" to "Standard_DS1_v2"
* improve reliability when locating the dashboard pod for `az aks browse`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
short-summary: Size in GB of the OS disk for each node in the node pool.
- name: --kubernetes-version -k
type: string
short-summary: Version of Kubernetes to use for creating the cluster, such as "1.7.7" or "1.8.2".
short-summary: Version of Kubernetes to use for creating the cluster, such as "1.7.12" or "1.8.6".
- name: --ssh-key-value
type: string
short-summary: Public key path or key contents to install on node VMs for SSH access. For example,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ def validate_create_parameters(namespace):


def validate_k8s_version(namespace):
"""Validates a string as a possible Kubernetes version."""
k8s_release_regex = re.compile(r'^[v|V]?(\d+\.\d+\.\d+.*)$')
found = k8s_release_regex.findall(namespace.kubernetes_version)
if found:
namespace.kubernetes_version = found[0]
else:
raise CLIError('--kubernetes-version should be the full version number, '
'such as "1.7.7" or "1.8.1"')
"""Validates a string as a possible Kubernetes version. An empty string is also valid, which tells the server
to use its default version."""
if namespace.kubernetes_version:
k8s_release_regex = re.compile(r'^[v|V]?(\d+\.\d+\.\d+.*)$')
found = k8s_release_regex.findall(namespace.kubernetes_version)
if found:
namespace.kubernetes_version = found[0]
else:
raise CLIError('--kubernetes-version should be the full version number, '
'such as "1.7.12" or "1.8.6"')


def validate_k8s_client_version(namespace):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
dns_name_prefix=None,
location=None,
admin_username="azureuser",
kubernetes_version="1.7.7",
kubernetes_version='',
node_vm_size="Standard_DS1_v2",
node_osdisk_size=0,
node_count=3,
Expand Down

0 comments on commit 7b9e6fb

Please sign in to comment.