Skip to content

Commit 9c05b6a

Browse files
committed
remove --disable-pod-security-policy as it's deprecated
1 parent eaa93fc commit 9c05b6a

File tree

7 files changed

+1
-107
lines changed

7 files changed

+1
-107
lines changed

linter_exclusions.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ aks update:
132132
cluster_autoscaler_profile:
133133
rule_exclusions:
134134
- option_length_too_long
135-
disable_pod_security_policy:
136-
rule_exclusions:
137-
- option_length_too_long
138135
load_balancer_idle_timeout:
139136
rule_exclusions:
140137
- option_length_too_long

src/aks-preview/HISTORY.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Pending
1414

1515
18.0.0b1
1616
+++++++
17-
* [BREAKING CHANGE] Remove "--enable-pod-security-policy" as it's deprecated.
17+
* [BREAKING CHANGE] Remove "--enable-pod-security-policy" and "--disable-pod-security-policy" as it's deprecated.
1818

1919
17.0.0b1
2020
+++++++

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -860,10 +860,6 @@
860860
type: string
861861
short-summary: How outbound traffic will be configured for a cluster.
862862
long-summary: This option will change the way how the outbound connections are managed in the AKS cluster. Available options are loadbalancer, managedNATGateway, userAssignedNATGateway, userDefinedRouting, none and block. For custom vnet, loadbalancer, userAssignedNATGateway and userDefinedRouting are supported. For aks managed vnet, loadbalancer, managedNATGateway and userDefinedRouting are supported.
863-
- name: --disable-pod-security-policy
864-
type: bool
865-
short-summary: Disable pod security policy
866-
long-summary: PodSecurityPolicy is deprecated. See https://aka.ms/aks/psp for details.
867863
- name: --nrg-lockdown-restriction-level
868864
type: string
869865
short-summary: Restriction level on the managed node resource.
@@ -1268,8 +1264,6 @@
12681264
text: az aks update --disable-cluster-autoscaler -g MyResourceGroup -n MyManagedCluster
12691265
- name: Update min-count or max-count for cluster autoscaler.
12701266
text: az aks update --update-cluster-autoscaler --min-count 1 --max-count 10 -g MyResourceGroup -n MyManagedCluster
1271-
- name: Disable pod security policy.
1272-
text: az aks update --disable-pod-security-policy -g MyResourceGroup -n MyManagedCluster
12731267
- name: Update a kubernetes cluster with standard SKU load balancer to use two AKS created IPs for the load balancer outbound connection usage.
12741268
text: az aks update -g MyResourceGroup -n MyManagedCluster --load-balancer-managed-outbound-ip-count 2
12751269
- name: Update a kubernetes cluster with standard SKU load balancer to use the provided public IPs for the load balancer outbound connection usage.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,6 @@ def load_arguments(self, _):
11891189
)
11901190
c.argument("load_balancer_managed_outbound_ipv6_count", type=int)
11911191
c.argument("outbound_type", arg_type=get_enum_type(outbound_types))
1192-
c.argument("disable_pod_security_policy", action="store_true", is_preview=True)
11931192
c.argument("enable_pod_identity", action="store_true")
11941193
c.argument("enable_pod_identity_with_kubenet", action="store_true")
11951194
c.argument("disable_pod_identity", action="store_true")

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,6 @@ def aks_update(
685685
network_dataplane=None,
686686
ip_families=None,
687687
pod_cidr=None,
688-
disable_pod_security_policy=False,
689688
enable_pod_identity=False,
690689
enable_pod_identity_with_kubenet=False,
691690
disable_pod_identity=False,

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -983,24 +983,6 @@ def get_force_upgrade(self) -> Union[bool, None]:
983983
return not disable_force_upgrade
984984
return None
985985

986-
def _get_disable_pod_security_policy(self) -> bool:
987-
"""Internal function to obtain the value of disable_pod_security_policy.
988-
989-
:return: bool
990-
"""
991-
# read the original value passed by the command
992-
disable_pod_security_policy = self.raw_param.get("disable_pod_security_policy")
993-
# We do not support this option in create mode, therefore we do not read the value from `mc`.
994-
995-
return disable_pod_security_policy
996-
997-
def get_disable_pod_security_policy(self) -> bool:
998-
"""Obtain the value of disable_pod_security_policy.
999-
1000-
:return: bool
1001-
"""
1002-
return self._get_disable_pod_security_policy()
1003-
1004986
# pylint: disable=unused-argument
1005987
def _get_enable_managed_identity(
1006988
self, enable_validation: bool = False, read_only: bool = False
@@ -4486,17 +4468,6 @@ def update_kube_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:
44864468

44874469
return mc
44884470

4489-
def update_pod_security_policy(self, mc: ManagedCluster) -> ManagedCluster:
4490-
"""Update pod security policy for the ManagedCluster object.
4491-
4492-
:return: the ManagedCluster object
4493-
"""
4494-
self._ensure_mc(mc)
4495-
4496-
if self.context.get_disable_pod_security_policy():
4497-
mc.enable_pod_security_policy = False
4498-
return mc
4499-
45004471
def update_pod_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:
45014472
"""Update pod identity profile for the ManagedCluster object.
45024473
@@ -5279,8 +5250,6 @@ def update_mc_profile_preview(self) -> ManagedCluster:
52795250
# DO NOT MOVE: keep this on top, fetch and update the default ManagedCluster profile
52805251
mc = self.update_mc_profile_default()
52815252

5282-
# update pod security policy
5283-
mc = self.update_pod_security_policy(mc)
52845253
# update pod identity profile
52855254
mc = self.update_pod_identity_profile(mc)
52865255
# update workload identity profile

src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -700,22 +700,6 @@ def test_get_load_balancer_backend_pool_type(self):
700700
)
701701
self.assertEqual(ctx.get_load_balancer_backend_pool_type(), "nodeIP")
702702

703-
def test_get_disable_pod_security_policy(self):
704-
# default
705-
ctx_1 = AKSPreviewManagedClusterContext(
706-
self.cmd,
707-
AKSManagedClusterParamDict({"disable_pod_security_policy": False}),
708-
self.models,
709-
decorator_mode=DecoratorMode.UPDATE,
710-
)
711-
self.assertEqual(ctx_1.get_disable_pod_security_policy(), False)
712-
mc = self.models.ManagedCluster(
713-
location="test_location",
714-
enable_pod_security_policy=False,
715-
)
716-
ctx_1.attach_mc(mc)
717-
self.assertEqual(ctx_1.get_disable_pod_security_policy(), False)
718-
719703
def test_get_network_plugin(self):
720704
# default
721705
ctx_1 = AKSPreviewManagedClusterContext(
@@ -6498,54 +6482,6 @@ def test_update_http_proxy_config(self):
64986482
)
64996483
self.assertEqual(dec_mc_1, ground_truth_mc_1)
65006484

6501-
def test_update_pod_security_policy(self):
6502-
# default value in `aks_update`
6503-
dec_1 = AKSPreviewManagedClusterUpdateDecorator(
6504-
self.cmd,
6505-
self.client,
6506-
{
6507-
"disable_pod_security_policy": False,
6508-
},
6509-
CUSTOM_MGMT_AKS_PREVIEW,
6510-
)
6511-
mc_1 = self.models.ManagedCluster(
6512-
location="test_location",
6513-
enable_pod_security_policy=True,
6514-
)
6515-
dec_1.context.attach_mc(mc_1)
6516-
# fail on passing the wrong mc object
6517-
with self.assertRaises(CLIInternalError):
6518-
dec_1.update_pod_security_policy(None)
6519-
6520-
dec_mc_1 = dec_1.update_pod_security_policy(mc_1)
6521-
ground_truth_mc_1 = self.models.ManagedCluster(
6522-
location="test_location",
6523-
enable_pod_security_policy=True,
6524-
)
6525-
self.assertEqual(dec_mc_1, ground_truth_mc_1)
6526-
6527-
# custom value
6528-
dec_3 = AKSPreviewManagedClusterUpdateDecorator(
6529-
self.cmd,
6530-
self.client,
6531-
{
6532-
"disable_pod_security_policy": True,
6533-
},
6534-
CUSTOM_MGMT_AKS_PREVIEW,
6535-
)
6536-
6537-
mc_3 = self.models.ManagedCluster(
6538-
location="test_location",
6539-
enable_pod_security_policy=True,
6540-
)
6541-
dec_3.context.attach_mc(mc_3)
6542-
dec_mc_3 = dec_3.update_pod_security_policy(mc_3)
6543-
ground_truth_mc_3 = self.models.ManagedCluster(
6544-
location="test_location",
6545-
enable_pod_security_policy=False,
6546-
)
6547-
self.assertEqual(dec_mc_3, ground_truth_mc_3)
6548-
65496485
def test_update_pod_identity_profile(self):
65506486
# default value in `aks_update`
65516487
dec_1 = AKSPreviewManagedClusterUpdateDecorator(

0 commit comments

Comments
 (0)