Documentation
¶
Overview ¶
Package provision defines the interface for the infra provisioner.
Index ¶
- func NewRetryError(err error, interval time.Duration) error
- func NewRetryErrorf(interval time.Duration, format string, args ...any) error
- func NewRetryInterval(interval time.Duration) error
- type ConnectionParams
- type Context
- func (context *Context[T]) CreateConfigPatch(ctx context.Context, name string, data []byte) error
- func (context *Context[T]) GenerateSchematicID(ctx context.Context, logger *zap.Logger, opts ...SchematicOption) (string, error)
- func (context *Context[T]) GetRequestID() string
- func (context *Context[T]) GetTalosVersion() string
- func (context *Context[T]) SetMachineInfraID(value string)
- func (context *Context[T]) SetMachineUUID(value string)
- func (context *Context[T]) UnmarshalProviderData(dest any) error
- type FactoryClient
- type Provisioner
- type SchematicOption
- type SchematicOptions
- type Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRetryError ¶
NewRetryError should be returned from the provisioner when it hits the retryable error.
func NewRetryErrorf ¶
NewRetryErrorf should be returned from the provisioner when it hits the retryable error.
func NewRetryInterval ¶ added in v0.45.0
NewRetryInterval should be returned from the provisioner when it should be called after some interval again.
Types ¶
type ConnectionParams ¶ added in v0.45.0
ConnectionParams represents kernel params and join config for making the machine join Omni.
type Context ¶
type Context[T resource.Resource] struct { MachineRequestStatus *infra.MachineRequestStatus State T ConnectionParams ConnectionParams // contains filtered or unexported fields }
Context keeps all context which might be required for the provision calls.
func NewContext ¶
func NewContext[T resource.Resource]( machineRequest *infra.MachineRequest, machineRequestStatus *infra.MachineRequestStatus, state T, connectionParams ConnectionParams, imageFactory FactoryClient, runtime controller.QRuntime, ) Context[T]
NewContext creates a new provision context.
func (*Context[T]) CreateConfigPatch ¶ added in v0.45.0
CreateConfigPatch for the provisioned machine.
func (*Context[T]) GenerateSchematicID ¶
func (context *Context[T]) GenerateSchematicID(ctx context.Context, logger *zap.Logger, opts ...SchematicOption) (string, error)
GenerateSchematicID generate the final schematic out of the machine request. This method also calls the image factory and uploads the schematic there.
func (*Context[T]) GetRequestID ¶
GetRequestID returns machine request id.
func (*Context[T]) GetTalosVersion ¶
GetTalosVersion returns Talos version from the machine request.
func (*Context[T]) SetMachineInfraID ¶
SetMachineInfraID in the machine request status.
func (*Context[T]) SetMachineUUID ¶
SetMachineUUID in the machine request status.
func (*Context[T]) UnmarshalProviderData ¶ added in v0.45.0
UnmarshalProviderData reads provider data string from the machine request into the dest.
type FactoryClient ¶
type FactoryClient interface {
EnsureSchematic(context.Context, schematic.Schematic) (string, error)
}
FactoryClient ensures that the given schematic exists in the image factory.
type Provisioner ¶
type Provisioner[T resource.Resource] interface { ProvisionSteps() []Step[T] Deprovision(context.Context, *zap.Logger, T, *infra.MachineRequest) error }
Provisioner is the interface that should be implemented by an infra provider.
type SchematicOption ¶
type SchematicOption func(*SchematicOptions)
SchematicOption is the optional argument to the GetSchematicID method.
func WithExtraExtensions ¶
func WithExtraExtensions(extensions ...string) SchematicOption
WithExtraExtensions adds more extensions to the schematic. The provider can detect the hardware and install some extensions automatically using this method.
func WithExtraKernelArgs ¶
func WithExtraKernelArgs(args ...string) SchematicOption
WithExtraKernelArgs adds kernel args to the schematic. This method doesn't remove duplicate kernel arguments.
func WithMetaValues ¶
func WithMetaValues(values ...schematic.MetaValue) SchematicOption
WithMetaValues adds meta values to the generated schematic. If the meta values with the same names are already set they are overwritten.
func WithOverlay ¶
func WithOverlay(overlay schematic.Overlay) SchematicOption
WithOverlay sets the overlay on the schematic.
func WithoutConnectionParams ¶
func WithoutConnectionParams() SchematicOption
WithoutConnectionParams generates the schematic without embedding connection params into the kernel args. This flag might be useful for providers which use PXE to boot the machines, so the schematics won't need the parameters for Omni connection. This can allow to minimize the amount of schematics needed to be generated for the provider.
type SchematicOptions ¶
type SchematicOptions struct {
// contains filtered or unexported fields
}
SchematicOptions is used during schematic ID generation.