ignitionpayload

package
v0.1.89 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LabelOwnerNamespace = "hypershift.openshift.io/ignition-payload-owner-namespace"
	LabelOwnerName      = "hypershift.openshift.io/ignition-payload-owner-name"

	// Exact values stored in annotations (no length limit) are the source of truth for
	// equality matching; labels carry a fixed-length digest so List selectors stay effective
	// regardless of value length.
	AnnotationOwnerNamespaceExact = "hypershift.openshift.io/ignition-payload-owner-namespace-exact"
	AnnotationOwnerNameExact      = "hypershift.openshift.io/ignition-payload-owner-name-exact"
	// AnnotationRolloutGeneration records the rollout generation this entry serves; it is the
	// second half of the store key, recovered by ListByOwner for the sweep/cleanup paths.
	AnnotationRolloutGeneration = "hypershift.openshift.io/ignition-payload-rollout-generation"
	// AnnotationConfigHash records the payload-identity hash of the stored bytes, so the
	// generator can skip regeneration when it already matches (idempotent generation).
	AnnotationConfigHash = "hypershift.openshift.io/ignition-payload-config-hash"
)

Label and annotation keys for SecretBackedStore.

Variables

View Source
var ErrNotFound = errors.New("ignition payload not found")

ErrNotFound is returned when a (owner, rolloutGeneration) identity has no store entry.

Functions

This section is empty.

Types

type MemStore

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

MemStore is an in-memory PayloadStore for testing.

func NewMemStore

func NewMemStore() *MemStore

NewMemStore creates a new in-memory PayloadStore.

func (*MemStore) Delete

func (s *MemStore) Delete(ctx context.Context, owner OwnerRef, rolloutGeneration int64) error

func (*MemStore) Get

func (s *MemStore) Get(ctx context.Context, owner OwnerRef, rolloutGeneration int64) (payload []byte, configHash string, err error)

func (*MemStore) ListByOwner

func (s *MemStore) ListByOwner(ctx context.Context, owner OwnerRef) (rolloutGenerations []int64, err error)

func (*MemStore) Put

func (s *MemStore) Put(ctx context.Context, owner OwnerRef, rolloutGeneration int64, configHash string, payload []byte) error

type OwnerRef

type OwnerRef struct {
	Namespace string
	Name      string
}

OwnerRef identifies the IgnitionPayload CR that owns a store entry.

type PayloadStore

type PayloadStore interface {
	// Put stores payload under (owner, rolloutGeneration), (re)setting the configHash it
	// records. If the entry already exists its bytes/configHash are overwritten in place
	// (last-write-wins; the Policy A refresh path).
	Put(ctx context.Context, owner OwnerRef, rolloutGeneration int64, configHash string, payload []byte) error
	// Get returns the payload bytes and the recorded configHash for (owner, rolloutGeneration),
	// or ErrNotFound. The serving tier uses payload; the generator compares configHash for
	// idempotent regeneration.
	Get(ctx context.Context, owner OwnerRef, rolloutGeneration int64) (payload []byte, configHash string, err error)
	// Delete removes the entry for (owner, rolloutGeneration). No-op (nil) if already absent.
	Delete(ctx context.Context, owner OwnerRef, rolloutGeneration int64) error
	// ListByOwner returns all rolloutGenerations owned by owner (empty slice if none), for the
	// inline per-CR sweep and the store-cleanup finalizer.
	ListByOwner(ctx context.Context, owner OwnerRef) (rolloutGenerations []int64, err error)
}

PayloadStore stores rendered ignition payloads out-of-band from the CRD, keyed by the rollout identity (owner + rolloutGeneration). It never stores or keys on the bearer token: the token is minted by the generator, lives only in the userdata Secret, and is verified statelessly by the serving tier. Keying on the generation (rather than on rolloutHash) keeps serving identity stable across a rolloutHash formula rebaseline, which rewrites rolloutHash without advancing rolloutGeneration. Each entry records the payload-identity hash (configHash) of its content for idempotent generation and observability. Implementations are backend-independent.

type SecretBackedStore

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

SecretBackedStore is a Secret-backed PayloadStore.

func NewSecretBackedStore

func NewSecretBackedStore(cfg *rest.Config, namespace string) (*SecretBackedStore, error)

NewSecretBackedStore creates a Secret-backed PayloadStore. It builds its own uncached client from cfg so reads go straight to the API server regardless of any informer cache state — the stateless, scaled serving tier must observe payloads the generator just wrote, and the store also performs writes (so a read-only API reader is insufficient).

func (*SecretBackedStore) Delete

func (s *SecretBackedStore) Delete(ctx context.Context, owner OwnerRef, rolloutGeneration int64) error

func (*SecretBackedStore) Get

func (s *SecretBackedStore) Get(ctx context.Context, owner OwnerRef, rolloutGeneration int64) (payload []byte, configHash string, err error)

func (*SecretBackedStore) ListByOwner

func (s *SecretBackedStore) ListByOwner(ctx context.Context, owner OwnerRef) (rolloutGenerations []int64, err error)

func (*SecretBackedStore) Put

func (s *SecretBackedStore) Put(ctx context.Context, owner OwnerRef, rolloutGeneration int64, configHash string, payload []byte) error

Jump to

Keyboard shortcuts

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