You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Ensure prompt initial DHCP cache sync on agent startup
This commit addresses a potential delay in the agent's DHCP lease cache
synchronization upon startup or leader election. Previously, the cache might
only populate after an explicit update to the watched IPPool CR.
Changes:
- Added an `AddFunc` to the IPPool informer in the agent's event handler
(`pkg/agent/ippool/event.go`). This ensures that IPPools listed during
the informer's initial LIST operation are queued for processing.
- Modified the agent's local IPPool controller (`pkg/agent/ippool/controller.go`)
to handle these "ADD" events identically to "UPDATE" events. This involves
calling the `Update` method to populate the DHCPAllocator's cache and then
signaling on the `initialSyncDone` channel.
These changes ensure that the agent primes its lease cache as soon as the
IPPool information is available from the informer, allowing the DHCP server
to start with accurate lease data more promptly.
logrus.Errorf("(controller.sync) failed to update DHCP lease store for IPPool %s/%s: %s", ipPool.Namespace, ipPool.Name, err.Error())
96
+
logrus.Errorf("(controller.sync) failed to update DHCP lease store for IPPool %s/%s during %s event: %s", ipPool.Namespace, ipPool.Name, event.action, err.Error())
96
97
returnerr// Return error to requeue
97
98
}
98
99
// If update was successful, this is a good place to signal initial sync
100
+
// This will be called for the first ADD or UPDATE event that successfully processes.
0 commit comments