Documentation
¶
Overview ¶
Package indextracker provides the IndexSynchronizationTracker that monitors resource watcher synchronization and publishes an event when all are synced.
The tracker:
- Subscribes to ResourceSyncCompleteEvent
- Tracks which resource types have completed initial sync
- Publishes IndexSynchronizedEvent when ALL resources are synced
- Allows the controller to wait for complete data before reconciliation
Index ¶
Constants ¶
const ComponentName = "index-tracker"
ComponentName is the unique identifier for the index synchronization tracker component.
const EventBufferSize = 100
EventBufferSize is the buffer size for the event subscription.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexSynchronizationTracker ¶
type IndexSynchronizationTracker struct {
*component.Base
// contains filtered or unexported fields
}
IndexSynchronizationTracker monitors resource synchronization and publishes an event when all resource types have completed initial sync.
func New ¶
func New( eventBus *busevents.EventBus, logger *slog.Logger, resourceNames []string, ) *IndexSynchronizationTracker
New creates a new IndexSynchronizationTracker.
Parameters:
- eventBus: EventBus for publishing/subscribing to events
- logger: Logger for diagnostic messages
- resourceNames: List of resource type names that must sync (from Config.WatchedResources keys)
The tracker expects to receive a ResourceSyncCompleteEvent for each resource type in resourceNames before publishing IndexSynchronizedEvent.
func (*IndexSynchronizationTracker) HandleEvent ¶
func (t *IndexSynchronizationTracker) HandleEvent(event busevents.Event)
HandleEvent implements component.EventHandler: it dispatches ResourceSyncCompleteEvent to the sync tracker.