Skip to content

Commit 757a969

Browse files
committed
update more
Signed-off-by: zirain <[email protected]>
1 parent e004096 commit 757a969

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

internal/gatewayapi/testdata/envoyproxy-accesslog-file-json-no-format.out.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ gatewayClass:
1111
kind: EnvoyProxy
1212
name: test
1313
namespace: envoy-gateway-system
14-
status: {}
14+
status:
15+
conditions:
16+
- lastTransitionTime: null
17+
message: Valid GatewayClass
18+
reason: Accepted
19+
status: "True"
20+
type: Accepted
1521
gateways:
1622
- apiVersion: gateway.networking.k8s.io/v1
1723
kind: Gateway

internal/gatewayapi/translator.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,10 @@ func (t *Translator) GetRelevantGateways(resources *resource.Resources) (
292292
) {
293293
envoyproxyMap := make(map[types.NamespacedName]*egv1a1.EnvoyProxy, len(resources.EnvoyProxiesForGateways)+1)
294294
envoyproxyValidationErrorMap := make(map[types.NamespacedName]error, len(resources.EnvoyProxiesForGateways))
295-
// make sure that the EnvoyProxyForGatewayClass is valid
296-
// TODO: how to handle EnvoyProxy for GatewayClass not found?
295+
296+
// if EnvoyProxy not found, provider layer set GC status to not accepted.
297+
// if EnvoyProxy found but invalid, set GC status to not accepted,
298+
// otherwise set GC status to accepted.
297299
if ep := resources.EnvoyProxyForGatewayClass; ep != nil {
298300
err := validateEnvoyProxy(ep)
299301
if err != nil {
@@ -304,7 +306,10 @@ func (t *Translator) GetRelevantGateways(resources *resource.Resources) (
304306
false, string(gwapiv1.GatewayClassReasonInvalidParameters),
305307
fmt.Sprintf("%s: %v", status.MsgGatewayClassInvalidParams, err))
306308
return
307-
} else {
309+
}
310+
311+
// TODO: remove this nil check after we update all the testdata.
312+
if resources.GatewayClass != nil {
308313
status.SetGatewayClassAccepted(
309314
resources.GatewayClass,
310315
true,

0 commit comments

Comments
 (0)