Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain committed May 26, 2024
1 parent 7033b65 commit 01e64de
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions internal/provider/kubernetes/predicates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,12 @@ func TestValidateServiceForReconcile(t *testing.T) {
},
ExtAuth: &v1alpha1.ExtAuth{
HTTP: &v1alpha1.HTTPExtAuthService{
BackendRef: &gwapiv1.BackendObjectReference{
Name: "ext-auth-http-service",
BackendRefs: []v1alpha1.BackendRef{
{
BackendObjectReference: gwapiv1.BackendObjectReference{
Name: "ext-auth-http-service",
},
},
},
},
},
Expand All @@ -606,6 +610,37 @@ func TestValidateServiceForReconcile(t *testing.T) {
service: test.GetService(types.NamespacedName{Name: "ext-auth-http-service"}, nil, nil),
expect: true,
},
{
name: "service referenced by SecurityPolicy ExtAuth GRPC service",
configs: []client.Object{
&v1alpha1.SecurityPolicy{
ObjectMeta: metav1.ObjectMeta{
Name: "ext-auth-http",
},
Spec: v1alpha1.SecurityPolicySpec{
TargetRef: gwapiv1a2.LocalPolicyTargetReferenceWithSectionName{
LocalPolicyTargetReference: gwapiv1a2.LocalPolicyTargetReference{
Kind: "Gateway",
Name: "scheduled-status-test",
},
},
ExtAuth: &v1alpha1.ExtAuth{
GRPC: &v1alpha1.GRPCExtAuthService{
BackendRefs: []v1alpha1.BackendRef{
{
BackendObjectReference: gwapiv1.BackendObjectReference{
Name: "ext-auth-grpc-service",
},
},
},
},
},
},
},
},
service: test.GetService(types.NamespacedName{Name: "ext-auth-grpc-service"}, nil, nil),
expect: true,
},
{
name: "service referenced by EnvoyExtensionPolicy ExtPrc GRPC service",
configs: []client.Object{
Expand Down

0 comments on commit 01e64de

Please sign in to comment.