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
28 changes: 16 additions & 12 deletions internal/controller/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ type eventHandlerConfig struct {
gatewayClassName string
// plus is whether or not we are running NGINX Plus.
plus bool
// InferenceExtension indicates if Gateway API Inference Extension support is enabled.
inferenceExtension bool
}

const (
Expand Down Expand Up @@ -372,18 +374,20 @@ func (h *eventHandlerImpl) updateStatuses(ctx context.Context, gr *graph.Graph,

// unfortunately, status is not on clusterState stored by the change processor, so we need to make a k8sAPI call here
ipList := &inference.InferencePoolList{}
err = h.cfg.k8sClient.List(ctx, ipList)
if err != nil {
msg := "error listing InferencePools for status update"
h.cfg.logger.Error(err, msg)
h.cfg.eventRecorder.Eventf(
&inference.InferencePoolList{},
v1.EventTypeWarning,
"ListInferencePoolsFailed",
msg+": %s",
err.Error(),
)
ipList = &inference.InferencePoolList{} // reset to empty list to avoid nil pointer dereference
if h.cfg.inferenceExtension {
err = h.cfg.k8sClient.List(ctx, ipList)
if err != nil {
msg := "error listing InferencePools for status update"
h.cfg.logger.Error(err, msg)
h.cfg.eventRecorder.Eventf(
&inference.InferencePoolList{},
v1.EventTypeWarning,
"ListInferencePoolsFailed",
msg+": %s",
err.Error(),
)
ipList = &inference.InferencePoolList{} // reset to empty list to avoid nil pointer dereference
}
}
inferencePoolReqs := status.PrepareInferencePoolRequests(
gr.ReferencedInferencePools,
Expand Down
1 change: 1 addition & 0 deletions internal/controller/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func StartManager(cfg config.Config) error {
plus: cfg.Plus,
statusQueue: statusQueue,
nginxDeployments: nginxUpdater.NginxDeployments,
inferenceExtension: cfg.InferenceExtension,
})

objects, objectLists := prepareFirstEventBatchPreparerArgs(cfg)
Expand Down
Loading