mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +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(),
|
psp: defaultPSP(),
|
||||||
expectedError: "ephemeral volumes are not allowed to be used",
|
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 {
|
for name, test := range errorCases {
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user