Skip to content

Commit 2038c7a

Browse files
committed
remove --disable-pod-security-policy as it's deprecated
1 parent 246d291 commit 2038c7a

File tree

8 files changed

+2
-108
lines changed

8 files changed

+2
-108
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.0b2
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.
@@ -1271,8 +1267,6 @@
12711267
text: az aks update --disable-cluster-autoscaler -g MyResourceGroup -n MyManagedCluster
12721268
- name: Update min-count or max-count for cluster autoscaler.
12731269
text: az aks update --update-cluster-autoscaler --min-count 1 --max-count 10 -g MyResourceGroup -n MyManagedCluster
1274-
- name: Disable pod security policy.
1275-
text: az aks update --disable-pod-security-policy -g MyResourceGroup -n MyManagedCluster
12761270
- name: Update a kubernetes cluster with standard SKU load balancer to use two AKS created IPs for the load balancer outbound connection usage.
12771271
text: az aks update -g MyResourceGroup -n MyManagedCluster --load-balancer-managed-outbound-ip-count 2
12781272
- 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
@@ -986,24 +986,6 @@ def get_force_upgrade(self) -> Union[bool, None]:
986986
return not disable_force_upgrade
987987
return None
988988

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

44974479
return mc
44984480

4499-
def update_pod_security_policy(self, mc: ManagedCluster) -> ManagedCluster:
4500-
"""Update pod security policy for the ManagedCluster object.
4501-
4502-
:return: the ManagedCluster object
4503-
"""
4504-
self._ensure_mc(mc)
4505-
4506-
if self.context.get_disable_pod_security_policy():
4507-
mc.enable_pod_security_policy = False
4508-
return mc
4509-
45104481
def update_pod_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:
45114482
"""Update pod identity profile for the ManagedCluster object.
45124483
@@ -5314,8 +5285,6 @@ def update_mc_profile_preview(self) -> ManagedCluster:
53145285
# DO NOT MOVE: keep this on top, fetch and update the default ManagedCluster profile
53155286
mc = self.update_mc_profile_default()
53165287

5317-
# update pod security policy
5318-
mc = self.update_pod_security_policy(mc)
53195288
# update pod identity profile
53205289
mc = self.update_pod_identity_profile(mc)
53215290
# 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
@@ -704,22 +704,6 @@ def test_get_load_balancer_backend_pool_type(self):
704704
)
705705
self.assertEqual(ctx.get_load_balancer_backend_pool_type(), "nodeIP")
706706

707-
def test_get_disable_pod_security_policy(self):
708-
# default
709-
ctx_1 = AKSPreviewManagedClusterContext(
710-
self.cmd,
711-
AKSManagedClusterParamDict({"disable_pod_security_policy": False}),
712-
self.models,
713-
decorator_mode=DecoratorMode.UPDATE,
714-
)
715-
self.assertEqual(ctx_1.get_disable_pod_security_policy(), False)
716-
mc = self.models.ManagedCluster(
717-
location="test_location",
718-
enable_pod_security_policy=False,
719-
)
720-
ctx_1.attach_mc(mc)
721-
self.assertEqual(ctx_1.get_disable_pod_security_policy(), False)
722-
723707
def test_get_network_plugin(self):
724708
# default
725709
ctx_1 = AKSPreviewManagedClusterContext(
@@ -6502,54 +6486,6 @@ def test_update_http_proxy_config(self):
65026486
)
65036487
self.assertEqual(dec_mc_1, ground_truth_mc_1)
65046488

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

src/aks-preview/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 setup, find_packages
1111

12-
VERSION = "17.0.0b2"
12+
VERSION = "18.0.0b1"
1313

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

0 commit comments

Comments
 (0)