mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 04:11:46 +00:00
Merge pull request #56848 from CaoShuFeng/duplicated-validation-psp
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. remove duplicated validation from podsecuritypolicy **Release note**: ```release-note NONE ```
This commit is contained in:
@@ -2235,14 +2235,11 @@ func TestPolicyAuthorizationErrors(t *testing.T) {
|
||||
}
|
||||
for desc, tc := range tests {
|
||||
t.Run(desc, func(t *testing.T) {
|
||||
var (
|
||||
authz = &TestAuthorizer{usernameToNamespaceToAllowedPSPs: tc.allowed}
|
||||
privileged = true
|
||||
)
|
||||
authz := &TestAuthorizer{usernameToNamespaceToAllowedPSPs: tc.allowed}
|
||||
pod := goodPod()
|
||||
pod.Namespace = ns
|
||||
pod.Spec.ServiceAccountName = sa
|
||||
pod.Spec.Containers[0].SecurityContext.Privileged = &privileged
|
||||
pod.Spec.SecurityContext.HostPID = true
|
||||
|
||||
plugin := NewTestAdmission(tc.inPolicies, authz)
|
||||
attrs := kadmission.NewAttributesRecord(pod, nil, kapi.Kind("Pod").WithVersion("version"), ns, "", kapi.Resource("pods").WithVersion("version"), "", kadmission.Create, &user.DefaultInfo{Name: userName})
|
||||
|
Reference in New Issue
Block a user