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

Ignore pdb #4718

Merged
merged 10 commits into from Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions src/aks-preview/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.5.64
++++++
* Add `--ignore-pod-disruption-budget` flag for `az aks nodepool delete` for ignoring PodDisruptionBudget.

0.5.63
++++++

Expand Down
7 changes: 7 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,13 @@
helps['aks nodepool delete'] = """
type: command
short-summary: Delete the agent pool in the managed Kubernetes cluster.
parameters:
- name: --ignore-pod-disruption-budget
type: bool
short-summary: (PREVIEW) ignore-pod-disruption-budget deletes an existing nodepool without considering Pod Disruption Budget.
examples:
- name: Delete an agent pool with --ignore-pod-disruption-budget
text: az aks nodepool delete --nodepool-name nodepool1 -g MyResourceGroup --cluster-name MyManagedCluster --ignore-pod-disruption-budget
"""

helps['aks addon'] = """
Expand Down
9 changes: 8 additions & 1 deletion src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,18 @@ def load_arguments(self, _):
c.argument('message_of_the_day', type=str,
validator=validate_message_of_the_day)

for scope in ['aks nodepool show', 'aks nodepool delete', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']:
for scope in ['aks nodepool show', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']:
with self.argument_context(scope) as c:
c.argument('nodepool_name', type=str, options_list=[
'--name', '-n'], validator=validate_nodepool_name, help='The node pool name.')

with self.argument_context('aks nodepool delete') as c:
c.argument('nodepool_name', type=str, options_list=[
'--name', '-n'], validator=validate_nodepool_name, help='The node pool name.')
c.argument('ignore_pod_disruption_budget', options_list=[
"--ignore-pod-disruption-budget", "-i"], action='store_true', is_preview=True,
help='delete an AKS nodepool by ignoring PodDisruptionBudget setting')

with self.argument_context('aks nodepool upgrade') as c:
c.argument('max_surge', type=str, validator=validate_max_surge)
c.argument('aks_custom_headers')
Expand Down
6 changes: 3 additions & 3 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@
from dateutil.parser import parse # pylint: disable=import-error
from dateutil.relativedelta import relativedelta # pylint: disable=import-error
from knack.log import get_logger
from knack.prompting import NoTTYException, prompt_pass
from knack.prompting import NoTTYException
from knack.util import CLIError
from msrestazure.azure_exceptions import CloudError
from six.moves.urllib.error import URLError # pylint: disable=import-error
from six.moves.urllib.request import urlopen # pylint: disable=import-error
from tabulate import tabulate # pylint: disable=import-error

from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW

from ._client_factory import (
Expand Down Expand Up @@ -1963,6 +1962,7 @@ def aks_agentpool_delete(cmd, # pylint: disable=unused-argument
resource_group_name,
cluster_name,
nodepool_name,
ignore_pod_disruption_budget=False,
no_wait=False):
agentpool_exists = False
instances = client.list(resource_group_name, cluster_name)
Expand All @@ -1975,7 +1975,7 @@ def aks_agentpool_delete(cmd, # pylint: disable=unused-argument
raise CLIError("Node pool {} doesnt exist, "
"use 'aks nodepool list' to get current node pool list".format(nodepool_name))

return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, cluster_name, nodepool_name)
return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, cluster_name, nodepool_name, ignore_pod_disruption_budget=ignore_pod_disruption_budget)


def aks_addon_list_available():
Expand Down
Loading