Documentation ¶
Index ¶
Constants ¶
const ( TokenSecretReleaseKey = "release" TokenSecretConfigKey = "config" TokenSecretTokenKey = "token" TokenSecretAnnotation = "hypershift.openshift.io/ignition-config" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpiringCache ¶
ExpiringCache enables a cache of pairs "token: payload". Any pair in the cache is expired once entry.expiry time is above the cache ttl. The expiry time is renewed for an existing value on every Get operation. Garbage collection of expired values happens on every Get operation.
func NewPayloadStore ¶
func NewPayloadStore() *ExpiringCache
func (*ExpiringCache) Delete ¶
func (c *ExpiringCache) Delete(key string)
func (*ExpiringCache) Set ¶
func (c *ExpiringCache) Set(key string, value []byte)
type IgnitionProvider ¶
type IgnitionProvider interface { // GetPayload returns the ignition payload content for // the provided release image and a config string containing 0..N MachineConfig yaml definitions. GetPayload(ctx context.Context, payloadImage, config string) ([]byte, error) }
IgnitionProvider can build ignition payload contents for a given release image.
type MCSIgnitionProvider ¶
type MCSIgnitionProvider struct { Client client.Client ReleaseProvider releaseinfo.Provider Namespace string }
MCSIgnitionProvider is an IgnitionProvider that uses MachineConfigServer pods to build ignition payload contents out of a given releaseImage and a config string containing 0..N MachineConfig yaml definitions.
func (*MCSIgnitionProvider) GetPayload ¶
type TokenSecretReconciler ¶
type TokenSecretReconciler struct { client.Client IgnitionProvider IgnitionProvider PayloadStore *ExpiringCache }
TokenSecretReconciler watches token Secrets and uses an IgnitionProvider to get a payload out them and stores it in the PayloadsStore. A token Secret is by contractual convention: type: Secret
metadata: annotations: hypershift.openshift.io/ignition-config: "true" data: token: <authz token> release: <release image string> config: |-