Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MachineReadyEventFn is the predicate function that returns true if the event indicates the machine is ready. MachineReadyEventFn = func(event client.EventResult) bool { machineStatusEvent, ok := event.Event.Payload.(*machineapi.MachineStatusEvent) if !ok { return false } return machineStatusEvent.GetStage() == machineapi.MachineStatusEvent_RUNNING && machineStatusEvent.GetStatus().GetReady() } // StopAllServicesEventFn is the predicate function that returns true if the event indicates that all services are being stopped. StopAllServicesEventFn = func(event client.EventResult) bool { taskEvent, ok := event.Event.Payload.(*machineapi.TaskEvent) if !ok { return false } return taskEvent.GetTask() == "stopAllServices" } // BootIDChangedPostCheckFn is a post check function that returns nil if the boot ID has changed. BootIDChangedPostCheckFn = func(ctx context.Context, c *client.Client, preActionBootID string) error { if preActionBootID == unauthorizedBootIDFallback { return nil } currentBootID, err := getBootID(ctx, c) if err != nil { return err } if preActionBootID == currentBootID { return retry.ExpectedErrorf("didn't reboot yet") } return nil } )
Functions ¶
This section is empty.
Types ¶
type ClientExecutor ¶ added in v1.8.0
type ClientExecutor interface { WithClient(action func(context.Context, *client.Client) error, dialOptions ...grpc.DialOption) error NodeList() []string }
ClientExecutor is the interface for the client executor.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker runs the action in the actionFn on the nodes and tracks its progress using the provided expectedEventFn and postCheckFn.
func NewTracker ¶
func NewTracker( clientExecutor ClientExecutor, expectedEventFn func(event client.EventResult) bool, actionFn func(ctx context.Context, c *client.Client) (string, error), opts ...TrackerOption, ) *Tracker
NewTracker creates a new Tracker.
type TrackerOption ¶
type TrackerOption func(*Tracker)
TrackerOption is the functional option for the Tracker.
func WithPostCheck ¶
func WithPostCheck(postCheckFn func(ctx context.Context, c *client.Client, preActionBootID string) error) TrackerOption
WithPostCheck sets the post check function.
func WithTerminalOverride ¶ added in v1.8.0
func WithTerminalOverride(isTerminal bool) TrackerOption
WithTerminalOverride sets the terminal override.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) TrackerOption
WithTimeout sets the timeout for the tracker.
Click to show internal directories.
Click to hide internal directories.