workersync

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package workersync reconciles Kubernetes worker pods into the Worker registry behind the ateapi Control API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WorkerPodInformer

WorkerPodInformer creates a SharedInformerFactory and SharedIndexInformer for worker pods. The resync period re-delivers every cached pod as an update, so a registry record that drifted without a corresponding pod event is repaired on the next sweep.

Types

type WorkerPoolSyncer

type WorkerPoolSyncer struct {
	// contains filtered or unexported fields
}

WorkerPoolSyncer reconciles the state of worker pods from Kubernetes Informer into the Worker registry, over the ateapi Control API.

Informer event handlers only enqueue keys; worker goroutines reconcile each key against the current informer cache state, requeuing with rate-limited backoff on transient failures such as a lost version precondition. The queue never hands the same key to two workers concurrently, so per-key ordering is preserved regardless of workerCount.

func NewWorkerPoolSyncer

func NewWorkerPoolSyncer(client ateapipb.ControlClient, pods corev1client.PodsGetter, workerInformer, workerPoolInformer cache.SharedIndexInformer, workerCount int) *WorkerPoolSyncer

NewWorkerPoolSyncer creates a new WorkerPoolSyncer. pods is used to delete worker pods that have reached a terminal phase.

func (*WorkerPoolSyncer) Start

func (s *WorkerPoolSyncer) Start(ctx context.Context)

Start registers the event handlers and starts the background workers. The informer's initial list synthesizes Add events for every existing pod, so no explicit startup re-list is needed as long as Start is called before the informer factory is started.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL