diff --git a/pkg/security/podsecuritypolicy/provider_test.go b/pkg/security/podsecuritypolicy/provider_test.go index a28372b3a5c..76c5a753d75 100644 --- a/pkg/security/podsecuritypolicy/provider_test.go +++ b/pkg/security/podsecuritypolicy/provider_test.go @@ -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) {