package
0.0.0-20230628214157-3bfe64699e82
Repository: https://github.com/gravitational/gravity.git
Documentation: pkg.go.dev

# Functions

AgentSecretsDir returns the location of agent credentials.
CanRollback checks if specified phase can be rolled back.
CheckMasterServer makes sure this method is executed on a master server.
CheckPlanCoordinator ensures that the node this function is invoked on is the coordinator node specified in the plan.
CompleteOrFailOperation completes or fails the operation given by the plan in the specified operator.
DiffChangelog returns a list of changelog entries from "local" that are missing from "remote".
FindPhase finds a phase with the specified id in the provided plan.
FollowOperationPlan returns a channel that will be receiving phase updates for the specified plan.
No description provided by the author
FormatOperationPlanShort formats provided operation plan as text with fewer number of columns.
No description provided by the author
No description provided by the author
GetClientCredentials reads the RPC credentials for an update operation from a predefined directory.
GetNumPhases computes the number of phases in the given plan.
GetOperationPlan returns plan for the specified operation.
GetPlanProgress returns phases of the plan that have been executed so far in the form of a changelog.
GetUpsertBootstrapResourceFunc returns a function that takes a Kubernetes object representing a bootstrap resource (ClusterRole, ClusterRoleBinding or PodSecurityPolicy) and creates or updates it using the provided client.
HasFailed returns true if the provided plan has at least one failed phase.
IsCompleted returns true if all phases of the provided plan are completed.
IsFailed returns true if all phases of the provided plan are either rolled back or unstarted.
IsMasterServer returns true if the provided service has a master cluster role.
IsRolledBack returns true if the provided plan is rolled back.
MarkCompleted marks all phases of the plan as completed.
New returns a new FSM instance.
NewAgentRunner creates a new RemoteRunner that uses a cluster of agents to run remote commands.
OperationKey returns the operation key for the specified operation plan.
OperationStateSetter returns the handler to set operation state both in the given operator as well as the specified backend.
RequireIfPresent takes a list of phase IDs and returns those that are present in the provided plan.
ResolvePlan applies changelog to the provided plan and returns the resulting plan.
RunCommand executes the provided command locally and returns its output.
SplitServers splits the specified server list into servers with master cluster role and regular nodes.
VisitPlan executes the specified callback on each phase in the plan.
VisitPlanRef executes the specified callback on each phase in the plan.

# Constants

CanRunLocally states that the task can run locally.
CanRunRemotely states that the task can run remotely.
ExecutionCheckUndefined signifies the unknown task execution mode.
RootPhase is the name of the top-level phase.
ShouldRunRemotely states that the task should run remotely.

# Structs

Config represents config.
ExecutorParams combines parameters needed for creating a new executor.
FSM is the generic FSM implementation that provides methods for phases execution and rollback, state transitioning and command execution.
Logger logs both to the configured underlying logger and to the operation log using the Operator it was initialized with.
Params combines parameters for phase execution/rollback.
PlanChangedEvent is sent when plan phases change states.
PlanCompletedEvent is sent when the plan is fully completed.
PlanRolledBackEvent is sent when the plan is fully rolled back.
StateChange represents phase state transition.

# Interfaces

Engine defines interface for specific FSM implementations.
PhaseExecutor defines an operation plan phase executor An executor performs a (compound) operation that it can then roll back in case any of the intermediate steps fail.
PlanEvent represents an operation plan event.
Remote allows to invoke remote commands.

# Type aliases

No description provided by the author
FSMSpecFunc defines a function that returns an appropriate executor for the specified operation phasenolint:revive // TODO: rename to SpecFunc.
GetPlanFunc is a function that returns an operation plan.
PhaseHookFn defines the phase hook function.