Documentation
¶
Index ¶
- Variables
- func AllSlaves(ctx context.Context) bool
- func BeganAt(ctx context.Context) time.Time
- func Env(ctx context.Context) []string
- func HasProps(ctx context.Context) bool
- func HasResourceSelector(ctx context.Context) bool
- func IsActionForMaster(ctx context.Context) bool
- func IsActionForSlave(ctx context.Context, nodename string) bool
- func IsAdopt(ctx context.Context) bool
- func IsConfirm(ctx context.Context) bool
- func IsCron(ctx context.Context) bool
- func IsFinalSync(ctx context.Context) bool
- func IsForce(ctx context.Context) bool
- func IsForceAffinity(ctx context.Context) bool
- func IsInterruptSyncs(ctx context.Context) bool
- func IsLeader(ctx context.Context) bool
- func IsLockDisabled(ctx context.Context) bool
- func IsLockTimeoutSet(ctx context.Context) bool
- func IsPreflight(ctx context.Context) bool
- func IsQuiet(ctx context.Context) bool
- func IsResourceSelected(ctx context.Context, path naming.Path, rid string) (selected, known bool)
- func IsRollbackDisabled(ctx context.Context) bool
- func IsStep(ctx context.Context) bool
- func LockTimeout(ctx context.Context) time.Duration
- func Master(ctx context.Context) bool
- func MoveTo(ctx context.Context) string
- func RID(ctx context.Context) string
- func Slaves(ctx context.Context) []string
- func Subset(ctx context.Context) string
- func SyncTo(ctx context.Context) []string
- func Tag(ctx context.Context) string
- func Target(ctx context.Context) []string
- func To(ctx context.Context) string
- func Verbose(ctx context.Context) int
- func WithAdopt(ctx context.Context, v bool) context.Context
- func WithAllSlaves(ctx context.Context, v bool) context.Context
- func WithBeganAt(ctx context.Context, t time.Time) context.Context
- func WithConfirm(ctx context.Context, v bool) context.Context
- func WithCron(ctx context.Context, v bool) context.Context
- func WithEnv(ctx context.Context, s []string) context.Context
- func WithFinalSync(ctx context.Context, v bool) context.Context
- func WithForce(ctx context.Context, v bool) context.Context
- func WithForceAffinity(ctx context.Context, v bool) context.Context
- func WithInterruptSyncs(ctx context.Context, v bool) context.Context
- func WithLeader(ctx context.Context, v bool) context.Context
- func WithLockDisabled(ctx context.Context, v bool) context.Context
- func WithLockTimeout(ctx context.Context, d time.Duration) context.Context
- func WithLockTimeoutSet(ctx context.Context, v bool) context.Context
- func WithMaster(ctx context.Context, v bool) context.Context
- func WithMoveTo(ctx context.Context, v string) context.Context
- func WithPreflight(ctx context.Context, v bool) context.Context
- func WithProps(ctx context.Context, props Properties) context.Context
- func WithQuiet(ctx context.Context, v bool) context.Context
- func WithRID(ctx context.Context, s string) context.Context
- func WithRestoreOptions(ctx context.Context, o RestoreOptions) context.Context
- func WithRollbackDisabled(ctx context.Context, v bool) context.Context
- func WithRunMarks(ctx context.Context, m RunMarks) context.Context
- func WithSelectedRIDs(ctx context.Context, path naming.Path, rids []string) context.Context
- func WithSlaves(ctx context.Context, s []string) context.Context
- func WithSubset(ctx context.Context, s string) context.Context
- func WithSyncTo(ctx context.Context, nodes []string) context.Context
- func WithTag(ctx context.Context, s string) context.Context
- func WithTarget(ctx context.Context, s []string) context.Context
- func WithTo(ctx context.Context, s string) context.Context
- func WithVerbose(ctx context.Context, v int) context.Context
- func WithoutResourceSelector(ctx context.Context) context.Context
- type Properties
- type RestoreOptions
- type RunMarks
Constants ¶
This section is empty.
Variables ¶
var ( Boot = Properties{ Name: "boot", Target: "booted", Progress: "booting", Failure: "boot failed", MustLock: true, Order: ordering.Desc, MarksStopped: true, TimeoutKeywords: []string{"timeout"}, PG: true, } Delete = Properties{ Name: "delete", Target: "deleted", Progress: "deleting", Failure: "delete failed", Order: ordering.Desc, MustLock: true, } Freeze = Properties{ Name: "freeze", Target: "frozen", Progress: "freezing", Failure: "freeze failed", PG: true, } PRStart = Properties{ Name: "prstart", Failure: "start failed", Progress: "starting", Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } PRStop = Properties{ Name: "prstop", Failure: "stop failed", MustLock: true, Order: ordering.Desc, Progress: "stopping", TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } Set = Properties{ Name: "set", MustLock: true, } SetProvisioned = Properties{ Name: "set provisioned", MustLock: true, } SetUnprovisioned = Properties{ Name: "set unprovisioned", MustLock: true, } Status = Properties{ Name: "status", PG: true, MustLock: true, LockGroup: "status", } Enable = Properties{ Name: "enable", MustLock: true, } Disable = Properties{ Name: "disable", MustLock: true, } Unset = Properties{ Name: "unset", MustLock: true, } ValidateConfig = Properties{ Name: "validate_config", MustLock: true, } Provision = Properties{ Name: "provision", Target: "provisioned", Progress: "provisioning", Failure: "provision failed", MustLock: true, Rollback: true, TimeoutKeywords: []string{"provision_timeout", "timeout"}, PG: true, } PushResInfo = Properties{ Name: "push resinfo", PG: true, } // Install installs again what the volumes and the filesystems of the // instance declare, as their start does, without starting anything. Install = Properties{ Name: "install", MustLock: true, PG: true, } Run = Properties{ Name: "run", TimeoutKeywords: []string{"run_timeout", "timeout"}, PG: true, } Shutdown = Properties{ Name: "shutdown", Target: "shutdown", Progress: "shutting", Failure: "shutdown failed", Order: ordering.Desc, TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, RemovesPG: true, } PGUpdate = Properties{ Name: "pg_update", MustLock: true, PG: true, } PGReset = Properties{ Name: "pg_reset", MustLock: true, PG: true, } Start = Properties{ Name: "start", Target: "started", Progress: "starting", Failure: "start failed", MustLock: true, ClearsStopped: true, Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } StartStandby = Properties{ Name: "startstandby", Progress: "starting", Failure: "start failed", MustLock: true, Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } Stop = Properties{ Name: "stop", Target: "stopped", Progress: "stopping", Failure: "stop failed", MustLock: true, Order: ordering.Desc, MarksStopped: true, TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, RemovesPG: true, } // ProvisionStop is the stop ending a provision off the placement // leader, which leaves stopped what the provision started on an // instance it found down. ProvisionStop = Properties{ Name: "stop", Target: "stopped", Progress: "stopping", Failure: "stop failed", MustLock: true, Order: ordering.Desc, StepOf: "provision", TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, RemovesPG: true, } SyncFull = Properties{ Name: "full", MustLock: true, PG: true, } SyncIngest = Properties{ Name: "sync_ingest", MustLock: true, PG: true, } // RestoreStop and RestoreStart are the steps of a sync restore --stop // bringing the instance to the state a restore in place needs: the // resources using the heads stopped, the heads started. The restore // flags the instance stopped itself, and the start leaves the flag // raised, so the daemon starts nothing back on its own. RestoreStop = Properties{ Name: "stop", Target: "stopped", Progress: "stopping", Failure: "stop failed", MustLock: true, Order: ordering.Desc, StepOf: "sync_restore", TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } RestoreStart = Properties{ Name: "start", Progress: "starting", Failure: "start failed", MustLock: true, StepOf: "sync_restore", TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } SyncRestore = Properties{ Name: "sync_restore", MustLock: true, PG: true, } SyncResync = Properties{ Name: "sync_resync", MustLock: true, PG: true, } SyncSplit = Properties{ Name: "sync_split", MustLock: true, PG: true, } SyncUpdate = Properties{ Name: "update", MustLock: true, PG: true, } Unfreeze = Properties{ Name: "unfreeze", Target: "unfrozen", Progress: "unfreezing", Failure: "unfreeze failed", PG: true, } // Unstop lowers the flags a stop raised, as a start does, and starts // nothing: the daemon may start the instance, or restart the // resources, on its own again. It takes the action lock a start and a // stop take, so a stop running meanwhile does not raise a flag it // lowered, or the other way round. Unstop = Properties{ Name: "unstop", MustLock: true, ClearsStopped: true, } Unprovision = Properties{ Name: "unprovision", Target: "unprovisioned", Progress: "unprovisioning", Failure: "unprovision failed", MustLock: true, Order: ordering.Desc, TimeoutKeywords: []string{"unprovision_timeout", "timeout"}, PG: true, RemovesPG: true, } )
Functions ¶
func HasResourceSelector ¶
func IsActionForMaster ¶
func IsFinalSync ¶
func IsForceAffinity ¶
IsForceAffinity says a start ignores the hard affinities of the object, asked by --force-affinity or --force.
func IsInterruptSyncs ¶
func IsLockDisabled ¶
func IsLockTimeoutSet ¶
func IsPreflight ¶
func IsResourceSelected ¶
IsResourceSelected tells whether the resource identified by rid, of the object at path, is among the ones recorded by WithSelectedRIDs. The known return value is false when no selection is recorded for this object, i.e. outside an action, during an action on all the resources, or during the status evaluation of another object, so the caller can apply its default policy.
func IsRollbackDisabled ¶
func IsStep ¶
IsStep tells whether the action of the context is a step of another action, which flags nothing stopped on purpose.
func SyncTo ¶
SyncTo returns the nodes a stop sends the sync resources to once the instance is stopped.
func WithAdopt ¶
WithAdopt has a provision take over the system resources it finds holding what it would take, as replicated storage a restored object finds, rather than refuse them.
func WithBeganAt ¶
WithBeganAt says when the action began, which the resources acting at different times of it share: the runs one sync update writes into several stores, under one snapshot id, carry this one time.
func WithFinalSync ¶
WithFinalSync says the sync is the last one of a stopped source, its destination not started: the sync of a source not started is allowed then, the data it would overwrite being older than its own.
func WithForceAffinity ¶
WithForceAffinity has a start ignore the hard affinities of the object, as --force does among the other checks.
func WithInterruptSyncs ¶
WithInterruptSyncs has a stop end the syncs running on the instance before stopping it, instead of waiting for the object lock they hold.
func WithLockTimeoutSet ¶
WithLockTimeoutSet says the lock timeout was given by the user, not defaulted: an action that would wait longer by default keeps to it.
func WithPreflight ¶
WithPreflight has a provision check only that nothing on the node holds what it would take, provisioning nothing.
func WithRestoreOptions ¶
func WithRestoreOptions(ctx context.Context, o RestoreOptions) context.Context
func WithSelectedRIDs ¶
WithSelectedRIDs records the rids of the resources an action with a resource selection works on or reads the state of, for the object at path. Drivers read it with IsResourceSelected, for example to spare a provider api call on a resource the action does not depend on.
The path scopes the rids: an action can evaluate the status of another object with the same context, like the start affinity checks do, and the resources of that object must not be judged by this selection.
func WithSyncTo ¶
WithSyncTo has a stop send, once the instance is stopped, the sync resources replicating to these nodes, as a switch asks of its source before the destination starts.
func WithoutResourceSelector ¶
WithoutResourceSelector returns the context of an action a resource runs on another object, as a volume resource does on its vol object. The resource selector of the action names resources of the object it runs on, so it must not select among the resources of the other object, which the resource acts on as a whole.
Types ¶
type Properties ¶
type Properties struct {
Name string
Target string
Progress string
Failure string
Order ordering.T
MustLock bool
LockGroup string
// MarksStopped says the action leaves the instance stopped on
// purpose, so the daemon must not start it back on its own until
// the object is wanted up again.
MarksStopped bool
// ClearsStopped says the action wants the instance up, so the
// daemon may start it on its own again.
ClearsStopped bool
// StepOf names the action this one is a step of, and is empty for
// an action asked for itself. A step flags nothing stopped on
// purpose, neither the instance nor a resource: the user asked for
// the action it is a step of, not for it.
StepOf string
Rollback bool
PG bool
TimeoutKeywords []string
// RemovesPG says the action, unscoped, leaves nothing running in
// the process groups of the object, which it removes when done,
// with the systemd properties of their slices: a capping would
// outlive the object otherwise, and cap the next one made under
// the same name.
RemovesPG bool
}
func Props ¶
func Props(ctx context.Context) Properties
type RestoreOptions ¶
type RestoreOptions struct {
// Snapshot is the run to restore, by id or a prefix of it: the
// latest run when empty.
Snapshot string
// Into is a directory to restore aside into, a directory per member,
// instead of into the heads.
Into string
// Config asks the configuration of the object restored: in place, it
// alone, aside, beside the heads.
Config bool
// ByRID asks each head restored into the current head of the resource
// of its rid, rather than at the path it was saved from.
ByRID bool
// Stop asks the instance brought to the state a restore in place
// needs, rather than the restore refused: the resources using the
// heads stopped, the heads started, and the instance left stopped.
Stop bool
// Heads are the heads to restore, every head of the run when empty.
Heads []string
// Refs is how the keys of the sec and cfg the object references are
// restored: missing, skip or overwrite, missing when empty.
Refs string
}
RestoreOptions are the options of a sync restore.
func Restore ¶
func Restore(ctx context.Context) RestoreOptions