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:
Patrick Ohly 2021-02-05 11:46:19 +01:00
parent 38384d5c13
commit aa4f8ae793

View File

@ -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) {