Documentation ¶
Overview ¶
Package v1alpha1 implements a `Runtime`.
Index ¶
- func ActivateLogicalVolumes(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func BootstrapEtcd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func CordonAndDrainNode(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func CreateOSReleaseFile(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func CreateSystemCgroups(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func DropCapabilities(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func EnforceKSPPRequirements(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func Install(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func KexecPrepare(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func LabelNodeAsMaster(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func LeaveEtcd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func LoadConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountBPFFS(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountBootPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountCgroups(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountEFIPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountEphemeralPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountOverlayFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountPseudoFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountStatePartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func MountUserDisks(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func OSRelease() (err error)
- func Reboot(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func RemoveAllPods(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func ResetSystemDisk(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func ResetSystemDiskSpec(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SaveConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SaveStateEncryptionConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SetRLimit(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SetUserEnvVars(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SetupLogger(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SetupSharedFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SetupSystemDirectory(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func SetupVarDirectory(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func Shutdown(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StartAllServices(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StartContainerd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StartDBus(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StartUdevd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StopAllPods(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StopAllServices(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StopDBus(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func StopServicesForUpgrade(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UncordonNode(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountBootPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountEFIPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountEphemeralPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountOverlayFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountPodMounts(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountStatePartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountSystemDiskBindMounts(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UnmountUserDisks(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func UpdateBootloader(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func Upgrade(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func ValidateConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func VerifyDiskAvailability(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func WriteIMAPolicy(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func WriteUdevRules(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- func WriteUserFiles(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
- type ClusterState
- type Controller
- func (c *Controller) ListenForEvents(ctx context.Context) error
- func (c *Controller) Run(ctx context.Context, seq runtime.Sequence, data interface{}, ...) error
- func (c *Controller) Runtime() runtime.Runtime
- func (c *Controller) Sequencer() runtime.Sequencer
- func (c *Controller) TryLock() bool
- func (c *Controller) Unlock() bool
- func (c *Controller) V1Alpha2() runtime.V1Alpha2Controller
- type DBusState
- type Events
- type MachineState
- func (s *MachineState) Close() error
- func (s *MachineState) DBus() runtime.DBusState
- func (s *MachineState) Disk(options ...disk.Option) *probe.ProbedBlockDevice
- func (s *MachineState) Installed() bool
- func (s *MachineState) IsInstallStaged() bool
- func (s *MachineState) IsKexecPrepared() bool
- func (s *MachineState) KexecPrepared(prepared bool)
- func (s *MachineState) StagedInstallImageRef() string
- func (s *MachineState) StagedInstallOptions() []byte
- type PhaseList
- type Runtime
- func (r *Runtime) CanApplyImmediate(cfg config.Provider) error
- func (r *Runtime) CancelConfigRollbackTimeout()
- func (r *Runtime) Config() config.Provider
- func (r *Runtime) Events() runtime.EventStream
- func (r *Runtime) IsBootstrapAllowed() bool
- func (r *Runtime) LoadAndValidateConfig(b []byte) (config.Provider, error)
- func (r *Runtime) Logging() runtime.LoggingManager
- func (r *Runtime) NodeName() (string, error)
- func (r *Runtime) RollbackToConfigAfter(cfg []byte, timeout time.Duration) error
- func (r *Runtime) SetConfig(cfg config.Provider) error
- func (r *Runtime) State() runtime.State
- type Sequencer
- func (*Sequencer) Boot(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Bootstrap(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Initialize(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Install(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Reboot(r runtime.Runtime) []runtime.Phase
- func (*Sequencer) Reset(r runtime.Runtime, in runtime.ResetOptions) []runtime.Phase
- func (*Sequencer) Shutdown(r runtime.Runtime, in *machineapi.ShutdownRequest) []runtime.Phase
- func (*Sequencer) StageUpgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []runtime.Phase
- func (*Sequencer) Upgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []runtime.Phase
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateLogicalVolumes ¶ added in v0.6.0
func ActivateLogicalVolumes(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
ActivateLogicalVolumes represents the task for activating logical volumes.
func BootstrapEtcd ¶
func BootstrapEtcd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
BootstrapEtcd represents the task for bootstrapping etcd.
func CordonAndDrainNode ¶
func CordonAndDrainNode(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
CordonAndDrainNode represents the task for stop all containerd tasks in the k8s.io namespace.
func CreateOSReleaseFile ¶
func CreateOSReleaseFile(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
CreateOSReleaseFile represents the CreateOSReleaseFile task.
func CreateSystemCgroups ¶ added in v0.12.0
func CreateSystemCgroups(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
CreateSystemCgroups represents the CreateSystemCgroups task.
func DropCapabilities ¶ added in v0.13.0
func DropCapabilities(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
DropCapabilities drops some capabilities so that they can't be restored by child processes.
func EnforceKSPPRequirements ¶
func EnforceKSPPRequirements(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
EnforceKSPPRequirements represents the EnforceKSPPRequirements task.
func Install ¶
func Install(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
Install mounts or installs the system partitions.
func KexecPrepare ¶ added in v0.13.0
func KexecPrepare(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
KexecPrepare loads next boot kernel via kexec_file_load.
func LabelNodeAsMaster ¶
func LabelNodeAsMaster(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
LabelNodeAsMaster represents the LabelNodeAsMaster task.
func LeaveEtcd ¶
func LeaveEtcd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
LeaveEtcd represents the task for removing a control plane node from etcd.
func LoadConfig ¶
func LoadConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
LoadConfig represents the LoadConfig task.
func MountBPFFS ¶
func MountBPFFS(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountBPFFS represents the MountBPFFS task.
func MountBootPartition ¶
func MountBootPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountBootPartition mounts the boot partition.
func MountCgroups ¶
func MountCgroups(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountCgroups represents the MountCgroups task.
func MountEFIPartition ¶ added in v0.7.0
func MountEFIPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountEFIPartition mounts the EFI partition.
func MountEphemeralPartition ¶ added in v0.9.0
func MountEphemeralPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountEphemeralPartition mounts the ephemeral partition.
func MountOverlayFilesystems ¶
func MountOverlayFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountOverlayFilesystems represents the MountOverlayFilesystems task.
func MountPseudoFilesystems ¶
func MountPseudoFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountPseudoFilesystems represents the MountPseudoFilesystems task.
func MountStatePartition ¶ added in v0.7.0
func MountStatePartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountStatePartition mounts the system partition.
func MountUserDisks ¶
func MountUserDisks(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
MountUserDisks represents the MountUserDisks task.
func OSRelease ¶
func OSRelease() (err error)
OSRelease renders a valid /etc/os-release file and writes it to disk. The node's OS Image field is reported by the node from /etc/os-release.
func Reboot ¶
func Reboot(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
Reboot represents the Reboot task.
func RemoveAllPods ¶
func RemoveAllPods(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
RemoveAllPods represents the task for stopping and removing all pods.
func ResetSystemDisk ¶
func ResetSystemDisk(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
ResetSystemDisk represents the task to reset the system disk.
func ResetSystemDiskSpec ¶ added in v0.8.0
func ResetSystemDiskSpec(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
ResetSystemDiskSpec represents the task to reset the system disk by spec.
func SaveConfig ¶
func SaveConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SaveConfig represents the SaveConfig task.
func SaveStateEncryptionConfig ¶ added in v0.9.0
func SaveStateEncryptionConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SaveStateEncryptionConfig saves state partition encryption info in the meta partition.
func SetRLimit ¶
func SetRLimit(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SetRLimit represents the SetRLimit task.
func SetUserEnvVars ¶
func SetUserEnvVars(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SetUserEnvVars represents the SetUserEnvVars task.
func SetupLogger ¶
func SetupLogger(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SetupLogger represents the SetupLogger task.
func SetupSharedFilesystems ¶
func SetupSharedFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SetupSharedFilesystems represents the SetupSharedFilesystems task.
func SetupSystemDirectory ¶
func SetupSystemDirectory(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SetupSystemDirectory represents the SetupSystemDirectory task.
func SetupVarDirectory ¶
func SetupVarDirectory(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
SetupVarDirectory represents the SetupVarDirectory task.
func Shutdown ¶
func Shutdown(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
Shutdown represents the Shutdown task.
func StartAllServices ¶
func StartAllServices(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StartAllServices represents the task to start the system services.
func StartContainerd ¶
func StartContainerd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StartContainerd represents the task to start containerd.
func StartDBus ¶ added in v1.0.0
func StartDBus(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StartDBus starts the D-Bus mock.
func StartUdevd ¶ added in v0.6.0
func StartUdevd(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StartUdevd represents the task to start udevd.
func StopAllPods ¶ added in v0.6.3
func StopAllPods(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StopAllPods represents the task for stopping all pods.
func StopAllServices ¶
func StopAllServices(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StopAllServices represents the StopAllServices task.
func StopDBus ¶ added in v1.0.0
func StopDBus(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StopDBus stops the D-Bus mock.
func StopServicesForUpgrade ¶
func StopServicesForUpgrade(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
StopServicesForUpgrade represents the StopServicesForUpgrade task.
func UncordonNode ¶ added in v0.6.0
func UncordonNode(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UncordonNode represents the task for mark node as scheduling enabled.
This action undoes the CordonAndDrainNode task.
func UnmountBootPartition ¶
func UnmountBootPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountBootPartition unmounts the boot partition.
func UnmountEFIPartition ¶ added in v0.7.0
func UnmountEFIPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountEFIPartition unmounts the EFI partition.
func UnmountEphemeralPartition ¶
func UnmountEphemeralPartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountEphemeralPartition unmounts the ephemeral partition.
func UnmountOverlayFilesystems ¶
func UnmountOverlayFilesystems(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountOverlayFilesystems represents the UnmountOverlayFilesystems task.
func UnmountPodMounts ¶
func UnmountPodMounts(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountPodMounts represents the UnmountPodMounts task.
func UnmountStatePartition ¶ added in v0.7.0
func UnmountStatePartition(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountStatePartition unmounts the system partition.
func UnmountSystemDiskBindMounts ¶
func UnmountSystemDiskBindMounts(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountSystemDiskBindMounts represents the UnmountSystemDiskBindMounts task.
func UnmountUserDisks ¶ added in v0.8.2
func UnmountUserDisks(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UnmountUserDisks represents the UnmountUserDisks task.
func UpdateBootloader ¶
func UpdateBootloader(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
UpdateBootloader represents the UpdateBootloader task.
func Upgrade ¶
func Upgrade(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
Upgrade represents the task for performing an upgrade.
func ValidateConfig ¶
func ValidateConfig(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
ValidateConfig validates the config.
func VerifyDiskAvailability ¶
func VerifyDiskAvailability(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
VerifyDiskAvailability represents the task for verifying that the system disk is not in use.
func WriteIMAPolicy ¶
func WriteIMAPolicy(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
WriteIMAPolicy represents the WriteIMAPolicy task.
func WriteUdevRules ¶ added in v0.14.0
func WriteUdevRules(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
WriteUdevRules is the task that writes udev rules to a udev rules file.
func WriteUserFiles ¶
func WriteUserFiles(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string)
WriteUserFiles represents the WriteUserFiles task.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller represents the controller responsible for managing the execution of sequences.
func NewController ¶
func NewController() (*Controller, error)
NewController intializes and returns a controller.
func (*Controller) ListenForEvents ¶
func (c *Controller) ListenForEvents(ctx context.Context) error
ListenForEvents starts the event listener. The listener will trigger a shutdown in response to a SIGTERM signal and ACPI button/power event.
func (*Controller) Run ¶
func (c *Controller) Run(ctx context.Context, seq runtime.Sequence, data interface{}, setters ...runtime.ControllerOption) error
Run executes all phases known to the controller in serial. `Controller` aborts immediately if any phase fails.
func (*Controller) Runtime ¶
func (c *Controller) Runtime() runtime.Runtime
Runtime implements the controller interface.
func (*Controller) Sequencer ¶
func (c *Controller) Sequencer() runtime.Sequencer
Sequencer implements the controller interface.
func (*Controller) TryLock ¶
func (c *Controller) TryLock() bool
TryLock attempts to set a lock that prevents multiple sequences from running at once. If currently locked, a value of true will be returned. If not currently locked, a value of false will be returned.
func (*Controller) Unlock ¶
func (c *Controller) Unlock() bool
Unlock removes the lock set by `TryLock`.
func (*Controller) V1Alpha2 ¶ added in v0.9.0
func (c *Controller) V1Alpha2() runtime.V1Alpha2Controller
V1Alpha2 implements the controller interface.
type DBusState ¶ added in v1.0.0
type DBusState struct {
// contains filtered or unexported fields
}
DBusState implements the logind mock.
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events represents the runtime event stream.
Events internally is implemented as circular buffer of `runtime.Event`. `e.stream` slice is allocated to the initial capacity and slice size doesn't change throughout the lifetime of Events.
To explain the internals, let's call `Publish()` method 'Publisher' (there might be multiple callers for it), and each `Watch()` handler as 'Consumer'.
For Publisher, `Events` keeps `e.writePos`, `e.writePos` is write offset into `e.stream`. Offset `e.writePos` is always incremeneted, real write index is `e.writePos % e.cap`
Each Consumer captures initial position it starts consumption from as `pos` which is local to each Consumer, as Consumers are free to work on their own pace. Following diagram shows Publisher and three Consumers:
Consumer 3 Consumer 2 pos = 27 pos = 34 e.stream []Event | | | | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |17 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+ | | | | Consumer 1 Publisher pos = 43 e.writePos = 50
Capacity of Events in this diagram is 18, Publisher published already 50 events, so it already overwrote `e.stream` twice fully.
Consumer1 is trying to keep up with the publisher, it has 14-7 = 7 events to catch up.
Consumer2 is reading events published by Publisher before last wraparound, it has 50-34 = 16 events to catch up. Consumer 2 has a lot of events to catch up, but as it stays on track, it can still do that.
Consumer3 is doing bad: 50-27 = 23 > 18 (capacity), so its read position has already been overwritten, it can't read consistent data, soit should error out.
Synchronization: at the moment single mutex protects `e.stream` and `e.writePos`, consumers keep their position as local variable, so it doesn't require synchronization. If Consumer catches up with Publisher, it sleeps on condition variable to be woken up by Publisher on next publish.
func NewEvents ¶
NewEvents initializes and returns the v1alpha1 runtime event stream.
Argument cap is a maximum event stream capacity (available event history). Argument gap is a safety gap to separate consumer from the publisher. Maximum available event history is (cap-gap).
type MachineState ¶
type MachineState struct {
// contains filtered or unexported fields
}
MachineState represents the machine's state.
func (*MachineState) Close ¶
func (s *MachineState) Close() error
Close implements the machine state interface.
func (*MachineState) DBus ¶ added in v1.0.0
func (s *MachineState) DBus() runtime.DBusState
DBus implements the machine state interface.
func (*MachineState) Disk ¶
func (s *MachineState) Disk(options ...disk.Option) *probe.ProbedBlockDevice
Disk implements the machine state interface.
func (*MachineState) Installed ¶
func (s *MachineState) Installed() bool
Installed implements the machine state interface.
func (*MachineState) IsInstallStaged ¶ added in v0.8.0
func (s *MachineState) IsInstallStaged() bool
IsInstallStaged implements the machine state interface.
func (*MachineState) IsKexecPrepared ¶ added in v0.13.0
func (s *MachineState) IsKexecPrepared() bool
IsKexecPrepared implements the machine state interface.
func (*MachineState) KexecPrepared ¶ added in v0.13.0
func (s *MachineState) KexecPrepared(prepared bool)
KexecPrepared implements the machine state interface.
func (*MachineState) StagedInstallImageRef ¶ added in v0.8.0
func (s *MachineState) StagedInstallImageRef() string
StagedInstallImageRef implements the machine state interface.
func (*MachineState) StagedInstallOptions ¶ added in v0.8.0
func (s *MachineState) StagedInstallOptions() []byte
StagedInstallOptions implements the machine state interface.
type PhaseList ¶
PhaseList represents a list of phases.
func (PhaseList) Append ¶
func (p PhaseList) Append(name string, tasks ...runtime.TaskSetupFunc) PhaseList
Append appends a task to the phase list.
func (PhaseList) AppendList ¶ added in v0.7.0
AppendList appends an additional PhaseList to the existing one.
func (PhaseList) AppendWhen ¶
AppendWhen appends a task to the phase list when `when` is `true`.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime implements the Runtime interface.
func NewRuntime ¶
func NewRuntime(c config.Provider, s runtime.State, e runtime.EventStream, l runtime.LoggingManager) *Runtime
NewRuntime initializes and returns the v1alpha1 runtime.
func (*Runtime) CanApplyImmediate ¶ added in v0.9.0
CanApplyImmediate implements the Runtime interface.
func (*Runtime) CancelConfigRollbackTimeout ¶ added in v1.1.0
func (r *Runtime) CancelConfigRollbackTimeout()
CancelConfigRollbackTimeout implements the Runtime interface.
func (*Runtime) Events ¶
func (r *Runtime) Events() runtime.EventStream
Events implements the Runtime interface.
func (*Runtime) IsBootstrapAllowed ¶ added in v1.0.0
IsBootstrapAllowed checks for CRI to be up, checked in the bootstrap method.
func (*Runtime) LoadAndValidateConfig ¶ added in v1.0.0
LoadAndValidateConfig implements the Runtime interface.
func (*Runtime) Logging ¶ added in v0.6.0
func (r *Runtime) Logging() runtime.LoggingManager
Logging implements the Runtime interface.
func (*Runtime) RollbackToConfigAfter ¶ added in v1.1.0
RollbackToConfigAfter implements the Runtime interface.
type Sequencer ¶
type Sequencer struct{}
Sequencer implements the sequencer interface.
func (*Sequencer) Boot ¶
Boot is the boot sequence. This primary goal if this sequence is to apply user supplied settings and start the services for the specific machine type. This sequence should never be reached if an installation is not found.
func (*Sequencer) Bootstrap ¶
Bootstrap is the bootstrap sequence. This primary goal if this sequence is to bootstrap Etcd and Kubernetes.
func (*Sequencer) Initialize ¶
Initialize is the initialize sequence. The primary goals of this sequence is to load the config and enforce kernel security requirements.
func (*Sequencer) Shutdown ¶
func (*Sequencer) Shutdown(r runtime.Runtime, in *machineapi.ShutdownRequest) []runtime.Phase
Shutdown is the shutdown sequence.
func (*Sequencer) StageUpgrade ¶ added in v0.8.0
func (*Sequencer) StageUpgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []runtime.Phase
StageUpgrade is the stage upgrade sequence.
func (*Sequencer) Upgrade ¶
func (*Sequencer) Upgrade(r runtime.Runtime, in *machineapi.UpgradeRequest) []runtime.Phase
Upgrade is the upgrade sequence.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State implements the state interface.
func (*State) Cluster ¶
func (s *State) Cluster() runtime.ClusterState
Cluster implements the state interface.
func (*State) Machine ¶
func (s *State) Machine() runtime.MachineState
Machine implements the state interface.
func (*State) V1Alpha2 ¶ added in v0.9.0
func (s *State) V1Alpha2() runtime.V1Alpha2State
V1Alpha2 implements the state interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
adv
Package adv provides common interfaces to access ADV data.
|
Package adv provides common interfaces to access ADV data. |
adv/syslinux
Package syslinux provides syslinux-compatible ADV data.
|
Package syslinux provides syslinux-compatible ADV data. |
adv/talos
Package talos implements modern ADV which supports large size for the values and tags.
|
Package talos implements modern ADV which supports large size for the values and tags. |
grub
Package grub provides the interface to the GRUB bootloader: config management, installation, etc.
|
Package grub provides the interface to the GRUB bootloader: config management, installation, etc. |