Skip to content

Commit a05ee0b

Browse files
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions into shrivastavp/dt_bug_fixes
2 parents 70ad463 + 5a4c6e4 commit a05ee0b

43 files changed

Lines changed: 8103 additions & 8132 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/policies/resourceManagement.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,8 @@ configuration:
614614
then:
615615
- mentionUsers:
616616
mentionees:
617-
- lasuredd-msft
618-
- fzkhan
619-
- pkuma-msft
617+
- ohnkoh-msft
618+
- joschung
620619
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
621620
assignMentionees: False
622621
- if:
@@ -2307,6 +2306,8 @@ configuration:
23072306
- mentionUsers:
23082307
mentionees:
23092308
- AzmonLogA
2309+
- raronen
2310+
- MeirMen
23102311
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
23112312
assignMentionees: False
23122313
- if:
@@ -2428,9 +2429,9 @@ configuration:
24282429
then:
24292430
- mentionUsers:
24302431
mentionees:
2431-
- t-bzhan
2432-
- gxue
2433-
- TracyYaoYao
2432+
- jingnanxu
2433+
- luxue
2434+
- arashz
24342435
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
24352436
assignMentionees: False
24362437
- if:

src/aks-agent/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414

15+
1.0.0b21
16+
++++++++
17+
* Bump aks-agent to v0.6.0
18+
* Bump aks-mcp to v0.0.16 to accept AKS managed webhook token path for workload identity
19+
1520
1.0.0b20
1621
++++++++
1722
* Bump aks-agent to v0.5.0

src/aks-agent/azext_aks_agent/_consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
AKS_MCP_LABEL_SELECTOR = "app.kubernetes.io/name=aks-mcp"
5353

5454
# AKS Agent Version (shared by helm chart and docker image)
55-
AKS_AGENT_VERSION = "0.5.0"
55+
AKS_AGENT_VERSION = "0.6.0"
5656

5757
# Helm Configuration
5858
HELM_VERSION = "3.16.0"

src/aks-agent/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from setuptools import find_packages, setup
1111

12-
VERSION = "1.0.0b20"
12+
VERSION = "1.0.0b21"
1313

1414
CLASSIFIERS = [
1515
"Development Status :: 4 - Beta",

src/aks-preview/HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
* Fix `match_condition` kwarg leaking to HTTP transport by overriding `put_mc` and `add_agentpool` to pass `if_match` / `if_none_match` directly to the vendored SDK. This change fixes the compatibility issue as azure-cli/acs module adopts TypeSpec emitted SDKs while azure-cli-extensions/aks-preview still uses the autorest emitted SDK.
15+
16+
19.0.0b27
17+
+++++++
18+
* `az aks nodepool add`: Fix `InvalidParameter` error when `mode` is `Machines`.
19+
1420
19.0.0b26
1521
+++++++
1622
* `az aks create/update`: Add `--enable-app-routing-istio` / `--disable-app-routing-istio` (short: `--enable-ari` / `--disable-ari`) flags to enable or disable Istio as a Gateway API implementation for App Routing.

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,25 @@
805805
806806
"""
807807

808+
helps['aks delete'] = """
809+
type: command
810+
short-summary: Delete a managed Kubernetes cluster.
811+
parameters:
812+
- name: --if-match
813+
type: string
814+
short-summary: The value provided will be compared to the ETag of the managed cluster, if it matches the operation will proceed. If it does not match, the request will be rejected to prevent accidental overwrites.
815+
- name: --if-none-match
816+
type: string
817+
short-summary: Not applicable for delete operations. This option will be ignored if provided.
818+
- name: --ignore-pod-disruption-budget
819+
type: bool
820+
short-summary: Delete those pods on a node without considering Pod Disruption Budget.
821+
examples:
822+
- name: Delete a managed Kubernetes cluster.
823+
text: az aks delete --name MyManagedCluster --resource-group MyResourceGroup
824+
crafted: true
825+
"""
826+
808827
helps['aks scale'] = """
809828
type: command
810829
short-summary: Scale the node pool in a managed Kubernetes cluster.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,11 @@ def load_arguments(self, _):
18211821
help="Disable continuous control plane and addon monitor for the cluster.",
18221822
)
18231823

1824+
with self.argument_context("aks delete") as c:
1825+
c.argument("if_match")
1826+
c.argument("if_none_match")
1827+
c.argument("ignore_pod_disruption_budget", action="store_true")
1828+
18241829
with self.argument_context("aks upgrade") as c:
18251830
c.argument("kubernetes_version", completer=get_k8s_upgrades_completion_list)
18261831
c.argument(

src/aks-preview/azext_aks_preview/agentpool_decorator.py

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
CONST_SSH_ACCESS_LOCALUSER,
4747
CONST_GPU_DRIVER_NONE,
4848
CONST_NODEPOOL_MODE_MANAGEDSYSTEM,
49+
CONST_NODEPOOL_MODE_MACHINES,
4950
)
5051
from azext_aks_preview._helpers import (
5152
get_nodepool_snapshot_by_snapshot_id,
@@ -1452,6 +1453,25 @@ def set_up_managed_system_mode(self, agentpool: AgentPool) -> AgentPool:
14521453

14531454
return agentpool
14541455

1456+
def set_up_machines_mode(self, agentpool: AgentPool) -> AgentPool:
1457+
"""Handle the special Machines mode by resetting all properties except name and mode.
1458+
1459+
:param agentpool: the AgentPool object
1460+
:return: the AgentPool object
1461+
"""
1462+
self._ensure_agentpool(agentpool)
1463+
1464+
mode = self.context.get_mode()
1465+
if mode == CONST_NODEPOOL_MODE_MACHINES:
1466+
agentpool.mode = CONST_NODEPOOL_MODE_MACHINES
1467+
# Make sure all other attributes are None
1468+
for attr in vars(agentpool):
1469+
if attr != 'name' and attr != 'mode' and not attr.startswith('_'):
1470+
if hasattr(agentpool, attr):
1471+
setattr(agentpool, attr, None)
1472+
1473+
return agentpool
1474+
14551475
def set_up_localdns_profile(self, agentpool: AgentPool) -> AgentPool:
14561476
"""Set up local DNS profile for the AgentPool object if provided via --localdns-config."""
14571477
self._ensure_agentpool(agentpool)
@@ -1468,11 +1488,12 @@ def construct_agentpool_profile_preview(self) -> AgentPool:
14681488
# DO NOT MOVE: keep this on top, construct the default AgentPool profile
14691489
agentpool = self.construct_agentpool_profile_default(bypass_restore_defaults=True)
14701490

1471-
# Check if mode is ManagedSystem, if yes, reset all properties
1491+
# Check if mode is ManagedSystem or Machines, if yes, reset all other properties
14721492
agentpool = self.set_up_managed_system_mode(agentpool)
1493+
agentpool = self.set_up_machines_mode(agentpool)
14731494

1474-
# If mode is ManagedSystem, skip all other property setups
1475-
if agentpool.mode == CONST_NODEPOOL_MODE_MANAGEDSYSTEM:
1495+
# If mode is ManagedSystem or Machines, skip all other property setups
1496+
if agentpool.mode == CONST_NODEPOOL_MODE_MANAGEDSYSTEM or agentpool.mode == CONST_NODEPOOL_MODE_MACHINES:
14761497
return agentpool
14771498

14781499
# set up preview vm properties
@@ -1597,6 +1618,22 @@ def set_up_blue_green_upgrade_settings(self, agentpool: AgentPool) -> AgentPool:
15971618

15981619
return agentpool
15991620

1621+
# pylint: disable=protected-access
1622+
def add_agentpool(self, agentpool: AgentPool) -> AgentPool:
1623+
"""Send request to add a new agentpool."""
1624+
self._ensure_agentpool(agentpool)
1625+
return sdk_no_wait(
1626+
self.context.get_no_wait(),
1627+
self.client.begin_create_or_update,
1628+
self.context.get_resource_group_name(),
1629+
self.context.get_cluster_name(),
1630+
self.context._get_nodepool_name(enable_validation=False),
1631+
agentpool,
1632+
if_match=self.context.get_if_match(),
1633+
if_none_match=self.context.get_if_none_match(),
1634+
headers=self.context.get_aks_custom_headers(),
1635+
)
1636+
16001637

16011638
class AKSPreviewAgentPoolUpdateDecorator(AKSAgentPoolUpdateDecorator):
16021639
def __init__(

src/aks-preview/azext_aks_preview/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def load_command_table(self, _):
168168
)
169169
g.custom_command("upgrade", "aks_upgrade", supports_no_wait=True)
170170
g.custom_command("scale", "aks_scale", supports_no_wait=True)
171-
g.command("delete", "begin_delete", supports_no_wait=True, confirmation=True)
171+
g.custom_command("delete", "aks_delete", supports_no_wait=True, confirmation=True)
172172
g.custom_show_command(
173173
"show", "aks_show", table_transformer=aks_show_table_format
174174
)

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,22 @@ def aks_show(cmd, client, resource_group_name, name, aks_custom_headers=None):
14451445
return _remove_nulls([mc])[0]
14461446

14471447

1448+
def aks_delete(cmd, client, resource_group_name, name, no_wait=False,
1449+
if_match=None, if_none_match=None, ignore_pod_disruption_budget=None):
1450+
if if_none_match is not None:
1451+
logger.warning(
1452+
"The '--if-none-match' option is not applicable to delete operations and will be ignored."
1453+
)
1454+
return sdk_no_wait(
1455+
no_wait,
1456+
client.begin_delete,
1457+
resource_group_name,
1458+
name,
1459+
if_match=if_match,
1460+
ignore_pod_disruption_budget=ignore_pod_disruption_budget,
1461+
)
1462+
1463+
14481464
# pylint: disable=unused-argument
14491465
def aks_stop(cmd, client, resource_group_name, name, no_wait=False):
14501466
instance = client.get(resource_group_name, name)

0 commit comments

Comments
 (0)