Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadECDSAPrivateKey ¶
func LoadECDSAPrivateKey(pemBytes []byte) (*ecdsa.PrivateKey, error)
LoadECDSAPrivateKey parses a PEM-encoded ECDSA private key (the generator's token-signing key).
func NewJWTMinter ¶
func NewJWTMinter(key *ecdsa.PrivateKey) *jwtMinter
NewJWTMinter builds a minter that signs tokens with the given ECDSA private key.
Types ¶
type Reconciler ¶
type Reconciler struct {
client.Client
Store payloadstore.PayloadStore
Generator *payloadGenerator
Minter TokenMinter
// ReleaseProvider resolves a release-image pullspec to its OCP version for the rollout/identity
// hashes (matching the deployed ConfigGenerator.Hash, which keys on releaseImage.Version()).
ReleaseProvider releaseinfo.Provider
Namespace string
// IgnitionCACert is the node-facing CA (PEM) embedded in authored userData so a booting node
// trusts the serving tier. IgnitionServerEndpoint is the host[:port] the node fetches from.
// Both are HCP-level facts injected at startup.
IgnitionCACert []byte
IgnitionServerEndpoint string
// TokenTTL bounds a minted token's validity; the userData token is re-issued once past half of
// it. Defaults to defaultTokenTTL when zero.
TokenTTL time.Duration
// contains filtered or unexported fields
}
Reconciler generates ignition payloads for IgnitionPayload CRs: it reads the config the CR names, validates it, computes the payload-identity and rollout hashes, renders+stores payloads keyed by rollout identity (owner + rolloutGeneration), authors the pointer-ignition userData Secret, and advances status to drive rollouts.
func NewReconciler ¶
func NewReconciler(cfg ReconcilerConfig) *Reconciler
NewReconciler builds a payload-controller Reconciler from its dependencies. It is the exported entry point for the ignition-payload-controller command.
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the reconciler: it owns IgnitionPayload and re-reconciles a CR when any ConfigMap or Secret the CR references by name changes.
type ReconcilerConfig ¶
type ReconcilerConfig struct {
Client client.Client
Store payloadstore.PayloadStore
Provider ignserver.IgnitionProvider
ReleaseProvider releaseinfo.Provider
Minter TokenMinter
Namespace string
IgnitionCACert []byte
IgnitionServerEndpoint string
TokenTTL time.Duration
}
ReconcilerConfig carries the dependencies the ignition-payload-controller wires into a Reconciler.
type ResolvedConfig ¶
type ResolvedConfig struct {
// RolloutManifests is the sorted, validated manifest set from spec.rolloutConfigMaps
// (user, core, NTO), joined with "\n---\n". Feeds the rollout hash and the payload.
RolloutManifests string
// ManagementManifests is the sorted, validated manifest set from spec.managementConfigMaps
// (the apiserver-HAProxy config). Excluded from the rollout hash; included in the
// rendered payload and the payload-identity hash.
ManagementManifests string
}
ResolvedConfig is the validated, deterministic output of reading a CR's ConfigMaps.
type TokenMinter ¶
type TokenMinter interface {
// Mint returns a signed bearer token scoped to owner, valid for ttl.
Mint(owner payloadstore.OwnerRef, ttl time.Duration) (string, error)
}
TokenMinter mints bearer tokens for node ignition fetches. The token authenticates the fetch and authorizes the owner (name-scope); it never identifies the payload (the request path + the rollout-generation header do), and it is never written to the PayloadStore or to status — it lives only inside the generator-authored userData Secret.