Skip to content

Commit

Permalink
Fixes Test Failures
Browse files Browse the repository at this point in the history
Signed-off-by: danehans <daneyonhansen@gmail.com>
  • Loading branch information
danehans committed Sep 23, 2022
1 parent 36b1d39 commit e4f32de
Show file tree
Hide file tree
Showing 58 changed files with 1,314 additions and 1,198 deletions.
2 changes: 1 addition & 1 deletion internal/crypto/certgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
DefaultEnvoyGatewayDNSPrefix = config.EnvoyGatewayServiceName

// DefaultEnvoyDNSPrefix defines the default Envoy DNS prefix.
DefaultEnvoyDNSPrefix = config.EnvoyServiceName
DefaultEnvoyDNSPrefix = "*"

// DefaultNamespace is the default Namespace name where Envoy Gateway is running.
DefaultNamespace = config.EnvoyGatewayNamespace
Expand Down
16 changes: 9 additions & 7 deletions internal/gatewayapi/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/types"

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

// IR is nil at start
require.Equal(t, (*ir.Xds)(nil), xdsIR.Get())
require.Equal(t, (*ir.Infra)(nil), infraIR.Get())
require.Equal(t, map[string]*ir.Xds{}, xdsIR.LoadAll())
require.Equal(t, map[string]*ir.Infra{}, infraIR.LoadAll())

// TODO: pass valid provider resources

// Reset gatewayclass slice and update with a nil gatewayclass to trigger a delete
pResources.DeleteGatewayClasses()
pResources.GatewayClasses.Store("test", nil)
// Reset gateway slice and update with a nil gateway to trigger a delete.
pResources.DeleteGateways()
key := types.NamespacedName{Namespace: "test", Name: "test"}
pResources.Gateways.Store(key, nil)
require.Eventually(t, func() bool {
out := xdsIR.Get()
out := xdsIR.LoadAll()
if out == nil {
return false
}
// Ensure ir is empty
return (reflect.DeepEqual(*xdsIR.Get(), ir.Xds{})) && (reflect.DeepEqual(*infraIR.Get(), ir.Infra{Proxy: nil}))
return (reflect.DeepEqual(xdsIR.LoadAll(), map[string]*ir.Xds{})) && (reflect.DeepEqual(infraIR.LoadAll(), map[string]*ir.Infra{}))
}, time.Second*1, time.Millisecond*20)

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,33 @@ httpRoutes:
reason: Accepted
message: Route is accepted
xdsIR:
http:
- name: envoy-gateway-gateway-1-http
address: 0.0.0.0
port: 10080
hostnames:
- "*"
routes:
- name: envoy-gateway-httproute-1-rule-0-match-0-*
pathMatch:
prefix: "/"
destinations:
- host: 7.7.7.7
port: 8080
weight: 1
envoy-gateway-gateway-1:
http:
- name: envoy-gateway-gateway-1-http
address: 0.0.0.0
port: 10080
hostnames:
- "*"
routes:
- name: envoy-gateway-httproute-1-rule-0-match-0-*
pathMatch:
prefix: "/"
destinations:
- host: 7.7.7.7
port: 8080
weight: 1
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
ports:
- name: envoy-gateway-gateway-1
protocol: "HTTP"
servicePort: 80
containerPort: 10080
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
ports:
- name: envoy-gateway-gateway-1
protocol: "HTTP"
servicePort: 80
containerPort: 10080
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,25 @@ httpRoutes:
reason: NotAllowedByListeners
message: No listeners included by this parent ref allowed this attachment.
xdsIR:
http:
- name: envoy-gateway-gateway-1-http
address: 0.0.0.0
hostnames:
- "*"
port: 10080
envoy-gateway-gateway-1:
http:
- name: envoy-gateway-gateway-1-http
address: 0.0.0.0
hostnames:
- "*"
port: 10080
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
ports:
- name: envoy-gateway-gateway-1
protocol: "HTTP"
servicePort: 80
containerPort: 10080
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
ports:
- name: envoy-gateway-gateway-1
protocol: "HTTP"
servicePort: 80
containerPort: 10080
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ httpRoutes:
status: "False"
reason: NoReadyListeners
message: There are no ready listeners for this parent ref
xdsIR: {}
xdsIR:
envoy-gateway-gateway-1: {}
infraIR:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gatewayclass: envoy-gateway-class
name: envoy-gateway-class
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
envoy-gateway-gateway-1:
proxy:
metadata:
labels:
gateway.envoyproxy.io/owning-gateway: gateway-1
name: envoy-gateway-gateway-1
image: envoyproxy/envoy:v1.23-latest
listeners:
- address: ""
Loading

0 comments on commit e4f32de

Please sign in to comment.