Skip to content

Commit b0fea99

Browse files
committed
fix e2e
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
1 parent dce2d87 commit b0fea99

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

test/e2e/testdata/envoy-patch-policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
type: JSONPatch
3030
jsonPatches:
3131
- type: "type.googleapis.com/envoy.config.listener.v3.Listener"
32-
name: "0.0.0.0-80"
32+
name: "0.0.0.0-10080"
3333
operation:
3434
op: add
3535
path: "/default_filter_chain/filters/0/typed_config/local_reply_config"

test/e2e/tests/envoy_patch_policy.go

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,12 @@
88
package tests
99

1010
import (
11-
"context"
12-
"fmt"
1311
"testing"
14-
"time"
1512

16-
"github.com/stretchr/testify/require"
1713
"k8s.io/apimachinery/pkg/types"
18-
"k8s.io/apimachinery/pkg/util/wait"
19-
"sigs.k8s.io/controller-runtime/pkg/client"
20-
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
21-
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
2214
"sigs.k8s.io/gateway-api/conformance/utils/http"
2315
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
2416
"sigs.k8s.io/gateway-api/conformance/utils/suite"
25-
"sigs.k8s.io/gateway-api/conformance/utils/tlog"
26-
27-
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
28-
"github.com/envoyproxy/gateway/internal/gatewayapi"
29-
"github.com/envoyproxy/gateway/internal/gatewayapi/resource"
3017
)
3118

3219
func init() {
@@ -43,15 +30,6 @@ var EnvoyPatchPolicyTest = suite.ConformanceTest{
4330
routeNN := types.NamespacedName{Name: "http-envoy-patch-policy", Namespace: ns}
4431
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
4532
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
46-
47-
ancestorRef := gwapiv1a2.ParentReference{
48-
Group: gatewayapi.GroupPtr(gwapiv1.GroupName),
49-
Kind: gatewayapi.KindPtr(resource.KindGateway),
50-
Namespace: gatewayapi.NamespacePtr(gwNN.Namespace),
51-
Name: gwapiv1.ObjectName(gwNN.Name),
52-
}
53-
envoyPatchPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "custom-response-patch-policy", Namespace: ns}, suite.ControllerName, ancestorRef)
54-
5533
OkResp := http.ExpectedResponse{
5634
Request: http.Request{
5735
Path: "/foo",
@@ -80,26 +58,3 @@ var EnvoyPatchPolicyTest = suite.ConformanceTest{
8058
})
8159
},
8260
}
83-
84-
// envoyPatchPolicyMustBeAccepted waits for the specified EnvoyPatchPolicy to be accepted.
85-
func envoyPatchPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference) {
86-
t.Helper()
87-
88-
waitErr := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 60*time.Second, true, func(ctx context.Context) (bool, error) {
89-
policy := &egv1a1.EnvoyPatchPolicy{}
90-
err := client.Get(ctx, policyName, policy)
91-
if err != nil {
92-
return false, fmt.Errorf("error fetching EnvoyPatchPolicy: %w", err)
93-
}
94-
95-
if policyAcceptedByAncestor(policy.Status.Ancestors, controllerName, ancestorRef) {
96-
tlog.Logf(t, "EnvoyPatchPolicy has been accepted: %v", policy)
97-
return true, nil
98-
}
99-
100-
tlog.Logf(t, "EnvoyPatchPolicy not yet accepted: %v", policy)
101-
return false, nil
102-
})
103-
104-
require.NoErrorf(t, waitErr, "error waiting for EnvoyPatchPolicy to be accepted")
105-
}

0 commit comments

Comments
 (0)