diff --git a/pkg/engine/handlers/validation/validate_pss.go b/pkg/engine/handlers/validation/validate_pss.go index 96a86d4c0d..c9c3842310 100644 --- a/pkg/engine/handlers/validation/validate_pss.go +++ b/pkg/engine/handlers/validation/validate_pss.go @@ -110,6 +110,8 @@ func getSpec(resource unstructured.Unstructured) (podSpec *corev1.PodSpec, metad podSpec = &pod.Spec metadata = &pod.ObjectMeta return podSpec, metadata, nil + } else { + return nil, nil, fmt.Errorf("Could not find correct resource type") } if err != nil { return nil, nil, err