mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
security: another test case for generic ephemeral inline volumes
When the PSP contains some other volume types, generic ephemeral inline volumes must be rejected.
This commit is contained in:
parent
38384d5c13
commit
aa4f8ae793
@ -502,6 +502,15 @@ func TestValidatePodFailures(t *testing.T) {
|
||||
psp: defaultPSP(),
|
||||
expectedError: "ephemeral volumes are not allowed to be used",
|
||||
},
|
||||
"generic ephemeral volumes with other volume type allowed": {
|
||||
pod: failGenericEphemeralPod,
|
||||
psp: func() *policy.PodSecurityPolicy {
|
||||
psp := defaultPSP()
|
||||
psp.Spec.Volumes = []policy.FSType{policy.NFS}
|
||||
return psp
|
||||
}(),
|
||||
expectedError: "ephemeral volumes are not allowed to be used",
|
||||
},
|
||||
}
|
||||
for name, test := range errorCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user