Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AKS][aks-preview] az aks nodepool upgrade: Add new parameter --aks-custom-headers #3658

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/aks-preview/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Release History
===============

0.5.24
+++++
* * Add "--aks-custom-headers" for "az aks nodepool upgrade"

0.5.23
+++++
* Fix issue that `maintenanceconfiguration add` subcommand cannot work
Expand Down
3 changes: 3 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,9 @@
- name: --max-surge
type: string
short-summary: Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33%
- name: --aks-custom-headers
type: string
short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2
"""

helps['aks nodepool update'] = """
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def load_arguments(self, _):

with self.argument_context('aks nodepool upgrade') as c:
c.argument('max_surge', type=str, validator=validate_max_surge)
c.argument('aks_custom_headers')

with self.argument_context('aks nodepool update') as c:
c.argument('enable_cluster_autoscaler', options_list=["--enable-cluster-autoscaler", "-e"], action='store_true')
Expand Down
7 changes: 5 additions & 2 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3308,7 +3308,8 @@ def aks_agentpool_upgrade(cmd, # pylint: disable=unused-argument
kubernetes_version='',
no_wait=False,
node_image_only=False,
max_surge=None):
max_surge=None,
aks_custom_headers=None):
if kubernetes_version != '' and node_image_only:
raise CLIError('Conflicting flags. Upgrading the Kubernetes version will also upgrade node image version.'
'If you only want to upgrade the node version please use the "--node-image-only" option only.')
Expand All @@ -3329,7 +3330,9 @@ def aks_agentpool_upgrade(cmd, # pylint: disable=unused-argument
if max_surge:
instance.upgrade_settings.max_surge = max_surge

return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, cluster_name, nodepool_name, instance)
headers = get_aks_custom_headers(aks_custom_headers)

return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, cluster_name, nodepool_name, instance, headers=headers)


def aks_agentpool_get_upgrade_profile(cmd, # pylint: disable=unused-argument
Expand Down
Loading