startupgate

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package startupgate provides a readiness check that succeeds once every node-applicable artifact CR has been locally reconciled.

Index

Constants

View Source
const (
	KindPlugin    = "Plugin"
	KindRulesfile = "Rulesfile"
	KindConfig    = "Config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeGateCall

type FakeGateCall struct {
	Kind, Namespace, Name string
	Generation            int64
}

type FakeGateRecorder

type FakeGateRecorder struct {
	Reconciled []FakeGateCall
	Forgotten  []FakeGateCall
}

FakeGateRecorder captures Recorder calls.

func (*FakeGateRecorder) Forget

func (r *FakeGateRecorder) Forget(kind, namespace, name string)

func (*FakeGateRecorder) MarkReconciled

func (r *FakeGateRecorder) MarkReconciled(kind, namespace, name string, generation int64)

type Gate

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

Gate tracks node-applicable artifact CRs and reports readiness when each has been locally reconciled at least once.

func NewGate

func NewGate(cl client.Client, nodeName, namespace string) *Gate

func (*Gate) Check

func (g *Gate) Check(_ *http.Request) error

Check returns nil when every snapshotted CR has been processed.

func (*Gate) Forget

func (g *Gate) Forget(kind, namespace, name string)

Forget drops a CR from both the snapshot and the processed set.

func (*Gate) MarkCacheSynced

func (g *Gate) MarkCacheSynced(ctx context.Context) error

MarkCacheSynced caches the node labels and builds the startup snapshot.

func (*Gate) MarkReconciled

func (g *Gate) MarkReconciled(kind, namespace, name string, generation int64)

MarkReconciled records that the CR was reconciled at the given generation.

type NoopGateRecorder

type NoopGateRecorder struct{}

NoopGateRecorder is a Recorder that ignores every call.

func (NoopGateRecorder) Forget

func (NoopGateRecorder) MarkReconciled

func (NoopGateRecorder) MarkReconciled(string, string, string, int64)

type Recorder

type Recorder interface {
	MarkReconciled(kind, namespace, name string, generation int64)
	Forget(kind, namespace, name string)
}

Recorder marks CRs as reconciled or forgotten.

Jump to

Keyboard shortcuts

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