Skip to content

Commit e4f32de

Browse files
committed
Fixes Test Failures
Signed-off-by: danehans <[email protected]>
1 parent 36b1d39 commit e4f32de

File tree

58 files changed

+1314
-1198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1314
-1198
lines changed

internal/crypto/certgen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
DefaultEnvoyGatewayDNSPrefix = config.EnvoyGatewayServiceName
2222

2323
// DefaultEnvoyDNSPrefix defines the default Envoy DNS prefix.
24-
DefaultEnvoyDNSPrefix = config.EnvoyServiceName
24+
DefaultEnvoyDNSPrefix = "*"
2525

2626
// DefaultNamespace is the default Namespace name where Envoy Gateway is running.
2727
DefaultNamespace = config.EnvoyGatewayNamespace

internal/gatewayapi/runner/runner_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"time"
88

99
"github.com/stretchr/testify/require"
10+
"k8s.io/apimachinery/pkg/types"
1011

1112
"github.com/envoyproxy/gateway/internal/envoygateway/config"
1213
"github.com/envoyproxy/gateway/internal/ir"
@@ -32,21 +33,22 @@ func TestRunner(t *testing.T) {
3233
require.NoError(t, err)
3334

3435
// IR is nil at start
35-
require.Equal(t, (*ir.Xds)(nil), xdsIR.Get())
36-
require.Equal(t, (*ir.Infra)(nil), infraIR.Get())
36+
require.Equal(t, map[string]*ir.Xds{}, xdsIR.LoadAll())
37+
require.Equal(t, map[string]*ir.Infra{}, infraIR.LoadAll())
3738

3839
// TODO: pass valid provider resources
3940

40-
// Reset gatewayclass slice and update with a nil gatewayclass to trigger a delete
41-
pResources.DeleteGatewayClasses()
42-
pResources.GatewayClasses.Store("test", nil)
41+
// Reset gateway slice and update with a nil gateway to trigger a delete.
42+
pResources.DeleteGateways()
43+
key := types.NamespacedName{Namespace: "test", Name: "test"}
44+
pResources.Gateways.Store(key, nil)
4345
require.Eventually(t, func() bool {
44-
out := xdsIR.Get()
46+
out := xdsIR.LoadAll()
4547
if out == nil {
4648
return false
4749
}
4850
// Ensure ir is empty
49-
return (reflect.DeepEqual(*xdsIR.Get(), ir.Xds{})) && (reflect.DeepEqual(*infraIR.Get(), ir.Infra{Proxy: nil}))
51+
return (reflect.DeepEqual(xdsIR.LoadAll(), map[string]*ir.Xds{})) && (reflect.DeepEqual(infraIR.LoadAll(), map[string]*ir.Infra{}))
5052
}, time.Second*1, time.Millisecond*20)
5153

5254
}

internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,33 @@ httpRoutes:
5454
reason: Accepted
5555
message: Route is accepted
5656
xdsIR:
57-
http:
58-
- name: envoy-gateway-gateway-1-http
59-
address: 0.0.0.0
60-
port: 10080
61-
hostnames:
62-
- "*"
63-
routes:
64-
- name: envoy-gateway-httproute-1-rule-0-match-0-*
65-
pathMatch:
66-
prefix: "/"
67-
destinations:
68-
- host: 7.7.7.7
69-
port: 8080
70-
weight: 1
57+
envoy-gateway-gateway-1:
58+
http:
59+
- name: envoy-gateway-gateway-1-http
60+
address: 0.0.0.0
61+
port: 10080
62+
hostnames:
63+
- "*"
64+
routes:
65+
- name: envoy-gateway-httproute-1-rule-0-match-0-*
66+
pathMatch:
67+
prefix: "/"
68+
destinations:
69+
- host: 7.7.7.7
70+
port: 8080
71+
weight: 1
7172
infraIR:
72-
proxy:
73-
metadata:
74-
labels:
75-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
76-
name: envoy-gateway-class
77-
image: envoyproxy/envoy:v1.23-latest
78-
listeners:
79-
- address: ""
80-
ports:
81-
- name: envoy-gateway-gateway-1
82-
protocol: "HTTP"
83-
servicePort: 80
84-
containerPort: 10080
73+
envoy-gateway-gateway-1:
74+
proxy:
75+
metadata:
76+
labels:
77+
gateway.envoyproxy.io/owning-gateway: gateway-1
78+
name: envoy-gateway-gateway-1
79+
image: envoyproxy/envoy:v1.23-latest
80+
listeners:
81+
- address: ""
82+
ports:
83+
- name: envoy-gateway-gateway-1
84+
protocol: "HTTP"
85+
servicePort: 80
86+
containerPort: 10080

internal/gatewayapi/testdata/gateway-allows-same-namespace-with-disallowed-httproute.out.yaml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,25 @@ httpRoutes:
5454
reason: NotAllowedByListeners
5555
message: No listeners included by this parent ref allowed this attachment.
5656
xdsIR:
57-
http:
58-
- name: envoy-gateway-gateway-1-http
59-
address: 0.0.0.0
60-
hostnames:
61-
- "*"
62-
port: 10080
57+
envoy-gateway-gateway-1:
58+
http:
59+
- name: envoy-gateway-gateway-1-http
60+
address: 0.0.0.0
61+
hostnames:
62+
- "*"
63+
port: 10080
6364
infraIR:
64-
proxy:
65-
metadata:
66-
labels:
67-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
68-
name: envoy-gateway-class
69-
image: envoyproxy/envoy:v1.23-latest
70-
listeners:
71-
- address: ""
72-
ports:
73-
- name: envoy-gateway-gateway-1
74-
protocol: "HTTP"
75-
servicePort: 80
76-
containerPort: 10080
65+
envoy-gateway-gateway-1:
66+
proxy:
67+
metadata:
68+
labels:
69+
gateway.envoyproxy.io/owning-gateway: gateway-1
70+
name: envoy-gateway-gateway-1
71+
image: envoyproxy/envoy:v1.23-latest
72+
listeners:
73+
- address: ""
74+
ports:
75+
- name: envoy-gateway-gateway-1
76+
protocol: "HTTP"
77+
servicePort: 80
78+
containerPort: 10080

internal/gatewayapi/testdata/gateway-with-listener-with-invalid-allowed-namespaces-selector.out.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ httpRoutes:
5959
status: "False"
6060
reason: NoReadyListeners
6161
message: There are no ready listeners for this parent ref
62-
xdsIR: {}
62+
xdsIR:
63+
envoy-gateway-gateway-1: {}
6364
infraIR:
64-
proxy:
65-
metadata:
66-
labels:
67-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
68-
name: envoy-gateway-class
69-
image: envoyproxy/envoy:v1.23-latest
70-
listeners:
71-
- address: ""
65+
envoy-gateway-gateway-1:
66+
proxy:
67+
metadata:
68+
labels:
69+
gateway.envoyproxy.io/owning-gateway: gateway-1
70+
name: envoy-gateway-gateway-1
71+
image: envoyproxy/envoy:v1.23-latest
72+
listeners:
73+
- address: ""

internal/gatewayapi/testdata/gateway-with-listener-with-invalid-allowed-routes-group.out.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ httpRoutes:
5757
status: "False"
5858
reason: NoReadyListeners
5959
message: There are no ready listeners for this parent ref
60-
xdsIR: {}
60+
xdsIR:
61+
envoy-gateway-gateway-1: {}
6162
infraIR:
62-
proxy:
63-
metadata:
64-
labels:
65-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
66-
name: envoy-gateway-class
67-
image: envoyproxy/envoy:v1.23-latest
68-
listeners:
69-
- address: ""
63+
envoy-gateway-gateway-1:
64+
proxy:
65+
metadata:
66+
labels:
67+
gateway.envoyproxy.io/owning-gateway: gateway-1
68+
name: envoy-gateway-gateway-1
69+
image: envoyproxy/envoy:v1.23-latest
70+
listeners:
71+
- address: ""

internal/gatewayapi/testdata/gateway-with-listener-with-invalid-allowed-routes-kind.out.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ httpRoutes:
5757
status: "False"
5858
reason: NoReadyListeners
5959
message: There are no ready listeners for this parent ref
60-
xdsIR: {}
60+
xdsIR:
61+
envoy-gateway-gateway-1: {}
6162
infraIR:
62-
proxy:
63-
metadata:
64-
labels:
65-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
66-
name: envoy-gateway-class
67-
image: envoyproxy/envoy:v1.23-latest
68-
listeners:
69-
- address: ""
63+
envoy-gateway-gateway-1:
64+
proxy:
65+
metadata:
66+
labels:
67+
gateway.envoyproxy.io/owning-gateway: gateway-1
68+
name: envoy-gateway-gateway-1
69+
image: envoyproxy/envoy:v1.23-latest
70+
listeners:
71+
- address: ""

internal/gatewayapi/testdata/gateway-with-listener-with-invalid-tls-configuration-invalid-mode.out.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ httpRoutes:
5757
status: "False"
5858
reason: NoReadyListeners
5959
message: There are no ready listeners for this parent ref
60-
xdsIR: {}
60+
xdsIR:
61+
envoy-gateway-gateway-1: {}
6162
infraIR:
62-
proxy:
63-
metadata:
64-
labels:
65-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
66-
name: envoy-gateway-class
67-
image: envoyproxy/envoy:v1.23-latest
68-
listeners:
69-
- address: ""
63+
envoy-gateway-gateway-1:
64+
proxy:
65+
metadata:
66+
labels:
67+
gateway.envoyproxy.io/owning-gateway: gateway-1
68+
name: envoy-gateway-gateway-1
69+
image: envoyproxy/envoy:v1.23-latest
70+
listeners:
71+
- address: ""

internal/gatewayapi/testdata/gateway-with-listener-with-invalid-tls-configuration-no-certificate-refs.out.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ httpRoutes:
5555
status: "False"
5656
reason: NoReadyListeners
5757
message: There are no ready listeners for this parent ref
58-
xdsIR: {}
58+
xdsIR:
59+
envoy-gateway-gateway-1: {}
5960
infraIR:
60-
proxy:
61-
metadata:
62-
labels:
63-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
64-
name: envoy-gateway-class
65-
image: envoyproxy/envoy:v1.23-latest
66-
listeners:
67-
- address: ""
61+
envoy-gateway-gateway-1:
62+
proxy:
63+
metadata:
64+
labels:
65+
gateway.envoyproxy.io/owning-gateway: gateway-1
66+
name: envoy-gateway-gateway-1
67+
image: envoyproxy/envoy:v1.23-latest
68+
listeners:
69+
- address: ""

internal/gatewayapi/testdata/gateway-with-listener-with-invalid-tls-configuration-secret-does-not-exist.out.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ httpRoutes:
6161
status: "False"
6262
reason: NoReadyListeners
6363
message: There are no ready listeners for this parent ref
64-
xdsIR: {}
64+
xdsIR:
65+
envoy-gateway-gateway-1: {}
6566
infraIR:
66-
proxy:
67-
metadata:
68-
labels:
69-
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
70-
name: envoy-gateway-class
71-
image: envoyproxy/envoy:v1.23-latest
72-
listeners:
73-
- address: ""
67+
envoy-gateway-gateway-1:
68+
proxy:
69+
metadata:
70+
labels:
71+
gateway.envoyproxy.io/owning-gateway: gateway-1
72+
name: envoy-gateway-gateway-1
73+
image: envoyproxy/envoy:v1.23-latest
74+
listeners:
75+
- address: ""

0 commit comments

Comments
 (0)