Skip to content
Merged
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
13 changes: 7 additions & 6 deletions internal/mode/static/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ type eventHandlerConfig struct {
nginxConfiguredOnStartChecker *nginxConfiguredOnStartChecker
// controlConfigNSName is the NamespacedName of the NginxGateway config for this controller.
controlConfigNSName types.NamespacedName
// version is the current version number of the nginx config.
version int
}

// filterKey is the `kind_namespace_name" of an object being filtered.
Expand Down Expand Up @@ -107,6 +105,9 @@ type eventHandlerImpl struct {

cfg eventHandlerConfig
lock sync.Mutex

// version is the current version number of the nginx config.
version int
}

// newEventHandlerImpl creates a new eventHandlerImpl.
Expand Down Expand Up @@ -177,8 +178,8 @@ func (h *eventHandlerImpl) HandleEventBatch(ctx context.Context, logger logr.Log
}
return
case state.EndpointsOnlyChange:
h.cfg.version++
cfg := dataplane.BuildConfiguration(ctx, graph, h.cfg.serviceResolver, h.cfg.version)
h.version++
cfg := dataplane.BuildConfiguration(ctx, graph, h.cfg.serviceResolver, h.version)

h.setLatestConfiguration(&cfg)

Expand All @@ -188,8 +189,8 @@ func (h *eventHandlerImpl) HandleEventBatch(ctx context.Context, logger logr.Log
cfg,
)
case state.ClusterStateChange:
h.cfg.version++
cfg := dataplane.BuildConfiguration(ctx, graph, h.cfg.serviceResolver, h.cfg.version)
h.version++
cfg := dataplane.BuildConfiguration(ctx, graph, h.cfg.serviceResolver, h.version)

h.setLatestConfiguration(&cfg)

Expand Down