Skip to content

Commit 6e08b2f

Browse files
committed
2 parents 58cdae8 + 6c076ea commit 6e08b2f

File tree

11 files changed

+2188
-1316
lines changed

11 files changed

+2188
-1316
lines changed

.github/actions/env-setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
label: ${{ toJSON(github.event.label) }}
1111
shell: bash
1212
run: |
13-
echo version cal job start
13+
echo start azdev env setup
1414
- name: Checkout CLI extension repo
1515
uses: actions/checkout@v4
1616
with:

.github/workflows/AzdevLinter.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,9 @@ jobs:
8989
for mod in ${changed_module_list[@]}
9090
do
9191
echo changed module: "${mod}"
92-
azdev extension add "${mod}" && azdev linter "${mod}" --min-severity medium --repo ./ --src "$diff_branch" --tgt "$merge_base"
93-
done
92+
azdev extension add "${mod}"
93+
# ado linter task
94+
azdev linter "${mod}" --min-severity medium
95+
done
96+
# linter task that needs git commit info
97+
azdev linter EXT --repo ./ --src "$diff_branch" --tgt "$merge_base" --rules missing_command_example

.github/workflows/AzdevStyle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,5 @@ jobs:
9090
do
9191
echo changed module: "${mod}"
9292
azdev extension add "${mod}"
93-
azdev style "${mod}"
93+
azdev style "${mod}"
9494
done

src/aks-preview/HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414
* Vendor new SDK and bump API version to 2025-01-02-preview.
15+
* Modify behavior for `--nodepool-initialization-taints` to ignore taints with hard effects on node pools with system mode when creating or updating a cluster.
1516

1617
14.0.0b1
1718
+++++++

src/aks-preview/azext_aks_preview/_helpers.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import stat
1010
import sys
1111
import tempfile
12-
from typing import TypeVar
12+
from typing import List, TypeVar
1313

1414
import yaml
1515
from azext_aks_preview._client_factory import (
@@ -374,3 +374,24 @@ def check_is_monitoring_addon_enabled(addons, instance):
374374
except Exception as ex: # pylint: disable=broad-except
375375
logger.debug("failed to check monitoring addon enabled: %s", ex)
376376
return is_monitoring_addon_enabled
377+
378+
379+
def filter_hard_taints(node_initialization_taints: List[str]) -> List[str]:
380+
filtered_taints = []
381+
for taint in node_initialization_taints:
382+
if not taint:
383+
continue
384+
# Parse the taint to get the effect
385+
taint_parts = taint.split(":")
386+
if len(taint_parts) == 2:
387+
effect = taint_parts[-1].strip()
388+
# Keep the taint if it has a soft effect (PreferNoSchedule)
389+
# or if it's a CriticalAddonsOnly taint - AKS allows those on system pools
390+
if effect.lower() == "prefernoschedule" or taint.lower().startswith("criticaladdonsonly"):
391+
filtered_taints.append(taint)
392+
else:
393+
logger.warning('Taint %s with hard effect will be skipped from system pool', taint)
394+
else:
395+
# If the taint doesn't have a recognizable format, keep it, if it's incorrect - AKS-RP will return an error
396+
filtered_taints.append(taint)
397+
return filtered_taints

src/aks-preview/azext_aks_preview/agentpool_decorator.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939
CONST_DEFAULT_WINDOWS_NODE_VM_SIZE,
4040
CONST_SSH_ACCESS_LOCALUSER,
4141
)
42-
from azext_aks_preview._helpers import get_nodepool_snapshot_by_snapshot_id
42+
from azext_aks_preview._helpers import (
43+
get_nodepool_snapshot_by_snapshot_id,
44+
filter_hard_taints,
45+
)
4346

4447
logger = get_logger(__name__)
4548

@@ -870,7 +873,11 @@ def set_up_init_taints(self, agentpool: AgentPool) -> AgentPool:
870873
:return: the AgentPool object
871874
"""
872875
self._ensure_agentpool(agentpool)
873-
agentpool.node_initialization_taints = self.context.get_node_initialization_taints()
876+
nodepool_initialization_taints = self.context.get_node_initialization_taints()
877+
# filter out taints with hard effects for System pools
878+
if agentpool.mode is None or agentpool.mode.lower() == "system":
879+
nodepool_initialization_taints = filter_hard_taints(nodepool_initialization_taints)
880+
agentpool.node_initialization_taints = nodepool_initialization_taints
874881
return agentpool
875882

876883
def set_up_artifact_streaming(self, agentpool: AgentPool) -> AgentPool:

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
check_is_private_cluster,
4848
get_cluster_snapshot_by_snapshot_id,
4949
setup_common_safeguards_profile,
50+
filter_hard_taints,
5051
)
5152
from azext_aks_preview._loadbalancer import create_load_balancer_profile
5253
from azext_aks_preview._loadbalancer import (
@@ -4954,7 +4955,11 @@ def update_nodepool_initialization_taints_mc(self, mc: ManagedCluster) -> Manage
49544955
nodepool_initialization_taints = self.context.get_nodepool_initialization_taints()
49554956
if nodepool_initialization_taints is not None:
49564957
for agent_profile in mc.agent_pool_profiles:
4957-
agent_profile.node_initialization_taints = nodepool_initialization_taints
4958+
if agent_profile.mode is not None and agent_profile.mode.lower() == "user":
4959+
agent_profile.node_initialization_taints = nodepool_initialization_taints
4960+
continue
4961+
# Filter out taints with hard effects (NoSchedule and NoExecute) for system pools
4962+
agent_profile.node_initialization_taints = filter_hard_taints(nodepool_initialization_taints)
49584963
return mc
49594964

49604965
def update_node_provisioning_mode(self, mc: ManagedCluster) -> ManagedCluster:

src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_check_network.yaml

Lines changed: 619 additions & 592 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)