You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Changed self.ctx.cmd.cli_ctx to self.ctx.cli_ctx in aks_safeguards_custom.py
- Added CLIError import from azure.cli.core.azclierror
- Updated test recordings for all three safeguards tests
- All tests passing: basic, argument_validation, with_pss
Copy file name to clipboardExpand all lines: src/aks-preview/azext_aks_preview/aaz/latest/aks/safeguards/_create.py
+39-28Lines changed: 39 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,19 @@ class Create(AAZCommand):
18
18
"""Enable Deployment Safeguards for a Managed Cluster
19
19
20
20
:example: Create a DeploymentSafeguards resource at Warn level with a managed cluster resource id
21
-
az aks safeguards create --resource /subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn
21
+
az aks safeguards create -c /subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn
22
22
23
23
:example: Create a DeploymentSafeguards resource at Warn level using subscription, resourcegroup, and name tags
24
24
az aks safeguards create --subscription subid1 -g rg1 -n cluster1 --level Warn
25
25
26
26
:example: Create a DeploymentSafeguards resource at Warn level with ignored namespaces
27
27
az aks safeguards create -g rg1 -n mc1 --excluded-ns ns1 ns2 --level Warn
28
28
29
-
:example: Create a DeploymentSafeguards resource at Warn level with pod security standards level set to Baseline
30
-
az aks safeguards create --managed-cluster subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn --pss-level Baseline
29
+
:example: Create a DeploymentSafeguards resource at Warn level with Pod Security Standards level set to Baseline
30
+
az aks safeguards create --managed-cluster /subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1 --level Warn --pss-level Baseline
31
+
32
+
:example: Create a DeploymentSafeguards resource with PSS level set to Restricted using -g/-n pattern
33
+
az aks safeguards create -g rg1 -n cluster1 --level Enforce --pss-level Restricted
help=r"The name of the resource group. You can configure the default group using "
52
-
r"`az configure --defaults group=`<name>``. You may provide either --managed-cluster "
53
-
r"or both --resource-group and --name, but not both.",
69
+
# pylint: disable=line-too-long
70
+
help="The name of the resource group. You can configure the default group using az configure --defaults group=`<name>`. You may provide either 'managed_cluster' or both 'resource_group' and 'name', but not both",
54
71
required=False,
55
72
)
56
73
_args_schema.cluster_name=AAZStrArg(
57
74
options=["--name", "-n"],
58
-
help="The name of the Managed Cluster. You may provide either --managed-cluster "
59
-
"or both --resource-group and --name, but not both.",
75
+
# pylint: disable=line-too-long
76
+
help="The name of the Managed Cluster.You may provide either 'managed_cluster' or both 'resource_group' and name', but not both.",
60
77
required=False,
61
78
)
62
79
_args_schema.managed_cluster.required=False
63
80
return_args_schema
64
81
65
82
66
83
classAKSSafeguardsShowCustom(Show):
67
-
"""Custom Show command for AKS Safeguards with -g/-n support"""
0 commit comments