Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions internal/gatewayapi/contexts.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ func (g *GatewayContext) ResetListeners(resources *resource.Resources, epMap map
listenerStatusIdx: i,
}
}

g.attachEnvoyProxy(resources, epMap)
}

func (g *GatewayContext) attachEnvoyProxy(resources *resource.Resources, epMap map[types.NamespacedName]*egv1a1.EnvoyProxy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@ gateways:
reason: InvalidParameters
status: "False"
type: Accepted
listeners:
- attachedRoutes: 0
conditions: null
name: http
supportedKinds: null
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this's a required field.

infraIR: {}
xdsIR: {}
4 changes: 3 additions & 1 deletion internal/gatewayapi/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ func (t *Translator) GetRelevantGateways(resources *resource.Resources) (
gCtx := &GatewayContext{
Gateway: gateway,
}
gCtx.attachEnvoyProxy(resources, envoyproxyMap)

// Gateways that are not accepted by the controller because they reference an invalid EnvoyProxy.
if status.GatewayNotAccepted(gCtx.Gateway) {
Expand All @@ -394,7 +395,6 @@ func (t *Translator) GetRelevantGateways(resources *resource.Resources) (
continue
}

gCtx.ResetListeners(resources, envoyproxyMap)
if ep := gCtx.envoyProxy; ep != nil {
key := utils.NamespacedName(ep)
if err, exits := envoyproxyValidationErrorMap[key]; exits {
Expand All @@ -406,6 +406,8 @@ func (t *Translator) GetRelevantGateways(resources *resource.Resources) (
}
}

// we cannot do this early, otherwise there's an error when updating status.
gCtx.ResetListeners(resources, envoyproxyMap)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to the logic change, can we delete

g.attachEnvoyProxy(resources, epMap)
?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if required by L398 to make sure envoyproxy is not alway nil.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I read wrong line, deleted.

acceptedGateways = append(acceptedGateways, gCtx)
}
return
Expand Down
2 changes: 1 addition & 1 deletion internal/infrastructure/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (r *Runner) updateProxyInfraFromSubscription(ctx context.Context, sub <-cha
// Subscribe to resources
message.HandleSubscription(message.Metadata{Runner: r.Name(), Message: message.InfraIRMessageName}, sub,
func(update message.Update[string, *ir.Infra], errChan chan error) {
r.Logger.Info("received an update")
r.Logger.Info("received an update", "key", update.Key, "delete", update.Delete)
val := update.Value

if update.Delete {
Expand Down