Documentation
¶
Overview ¶
Package teamintentobserver runs the independent Kubernetes status observer for durable team namespace intents. It inspects live cluster state and writes leased observations to Platform API without mutating intent, receipts, or River jobs.
Index ¶
Constants ¶
const ( ReasonAllPrerequisitesReady = "AllPrerequisitesReady" ReasonPrerequisiteDrifted = "PrerequisiteDrifted" ReasonNamespaceMissing = "NamespaceMissing" ReasonNamespaceTerminating = "NamespaceTerminating" ReasonNamespaceOwnershipMismatch = "NamespaceOwnershipMismatch" ReasonNamespaceUIDMismatch = "NamespaceUIDMismatch" ReasonAwaitingReconcile = "AwaitingReconcile" ReasonReconciling = "Reconciling" ReasonReconcileTerminal = "ReconcileTerminal" ReasonReconcileExhausted = "ReconcileExhausted" ReasonCleanupComplete = "CleanupComplete" ReasonCleanupPending = "CleanupPending" ReasonCleanupTerminal = "CleanupTerminal" ReasonTraefikWatchDrifted = "TraefikWatchDrifted" ReasonSupersededByNewIncarnation = "SupersededByNewIncarnation" )
Variables ¶
var ErrObserverLeaseLost = errors.New("observer lease superseded by newer epoch")
ErrObserverLeaseLost is returned when Platform API rejects an observation because a newer observer holds a higher lease epoch.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ClusterKey string
ObserverID string
Platform PlatformClient
K8sClient kubernetes.Interface
Traefik k8sprovision.TraefikWatchConfig
VerifyInterval time.Duration
InformerResync time.Duration
QueueMaxDepth int
Now func() time.Time
Logger *slog.Logger
}
Config configures the independent team namespace status observer.
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer watches managed Kubernetes namespaces and periodically verifies live prerequisites against Platform API's team namespace intents.
func (*Observer) ClaimLease ¶
ClaimLease acquires a monotonic observer epoch from Platform API.
func (*Observer) ObserveAll ¶
ObserveAll fetches all team intents from Platform API and records fresh live observations for every incarnation.
func (*Observer) ObserveTeam ¶
ObserveTeam fetches one team intent and records its live Kubernetes observation.
type PlatformClient ¶
type PlatformClient interface {
ListTeamIntents(ctx context.Context) ([]apikit.TeamNamespaceIntent, error)
GetTeamIntent(ctx context.Context, teamID string) (apikit.TeamNamespaceIntent, bool, error)
ClaimTeamIntentObserverLease(ctx context.Context, clusterKey, observerID string) (apikit.TeamIntentObserverLeaseResponse, error)
RecordTeamIntentObservation(ctx context.Context, teamID string, req apikit.TeamIntentObservationRequest) (apikit.TeamNamespaceObservation, error)
}
PlatformClient exposes only intent reads, observer lease claims, and observation writes. By design it cannot mutate intent, receipts, or jobs.