diff --git a/api/v1alpha1/validation/securitypolicy_validate.go b/api/v1alpha1/validation/securitypolicy_validate.go index 59a55abcac5e..66bee6a8eb5d 100644 --- a/api/v1alpha1/validation/securitypolicy_validate.go +++ b/api/v1alpha1/validation/securitypolicy_validate.go @@ -63,10 +63,6 @@ func validateSecurityPolicySpec(spec *egv1a1.SecurityPolicySpec) error { func ValidateJWTProvider(providers []egv1a1.JWTProvider) error { var errs []error - if len(providers) == 0 { - errs = append(errs, errors.New("no jwt providers are specified")) - } - var names []string for _, provider := range providers { switch { diff --git a/api/v1alpha1/validation/securitypolicy_validate_test.go b/api/v1alpha1/validation/securitypolicy_validate_test.go index e84d9fc1f175..489c7644f8b1 100644 --- a/api/v1alpha1/validation/securitypolicy_validate_test.go +++ b/api/v1alpha1/validation/securitypolicy_validate_test.go @@ -40,25 +40,6 @@ func TestValidateSecurityPolicy(t *testing.T) { }, expected: false, }, - { - name: "empty provider list", - policy: &egv1a1.SecurityPolicy{ - TypeMeta: metav1.TypeMeta{ - Kind: egv1a1.KindSecurityPolicy, - APIVersion: egv1a1.GroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: "test", - Name: "test", - }, - Spec: egv1a1.SecurityPolicySpec{ - JWT: &egv1a1.JWT{ - Providers: []egv1a1.JWTProvider{}, - }, - }, - }, - expected: false, - }, { name: "valid security policy with url", policy: &egv1a1.SecurityPolicy{