Documentation ¶
Index ¶
- func NewTaskRunner(task Task, writer filewriter.FileWriter, opts ...TaskRunnerOpt) *taskRunner
- func UnmarshalTaskCheckpoint(taskCheckpoint TaskCheckpoint, config TaskCheckpoint) error
- type CheckpointInfo
- type CommandContext
- type CompletedTask
- type Profiler
- type Task
- type TaskCheckpoint
- type TaskRunnerOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTaskRunner ¶
func NewTaskRunner(task Task, writer filewriter.FileWriter, opts ...TaskRunnerOpt) *taskRunner
func UnmarshalTaskCheckpoint ¶ added in v0.11.0
func UnmarshalTaskCheckpoint(taskCheckpoint TaskCheckpoint, config TaskCheckpoint) error
UnmarshalTaskCheckpoint marshals the received task checkpoint (type interface{}) then unmarshalls it into the desired type
specified in the Restore() method. When reading from a yaml file, there isn't a direct way in Go to do a type conversion from interface{} to the desired type. We use interface{} because the TaskCheckpoint type will vary depending on what's needed for a specific task. The known workaround for this is to marshal & unmarshal it into the checkpoint type.
Types ¶
type CheckpointInfo ¶ added in v0.9.2
type CheckpointInfo struct {
CompletedTasks map[string]*CompletedTask `json:"completedTasks"`
}
type CommandContext ¶
type CommandContext struct { Bootstrapper interfaces.Bootstrapper Provider providers.Provider ClusterManager interfaces.ClusterManager GitOpsManager interfaces.GitOpsManager Validations interfaces.Validator Writer filewriter.FileWriter EksdInstaller interfaces.EksdInstaller PackageInstaller interfaces.PackageInstaller EksdUpgrader interfaces.EksdUpgrader ClusterUpgrader interfaces.ClusterUpgrader CAPIManager interfaces.CAPIManager ClusterSpec *cluster.Spec CurrentClusterSpec *cluster.Spec UpgradeChangeDiff *types.ChangeDiff BootstrapCluster *types.Cluster ManagementCluster *types.Cluster WorkloadCluster *types.Cluster Profiler *Profiler OriginalError error ManagementClusterStateDir string ForceCleanup bool }
Command context maintains the mutable and shared entities.
func (*CommandContext) SetError ¶
func (c *CommandContext) SetError(err error)
type CompletedTask ¶ added in v0.9.2
type CompletedTask struct {
Checkpoint TaskCheckpoint `json:"checkpoint"`
}
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
func (*Profiler) MarkDoneTask ¶
needs to be called after setStart.
func (*Profiler) SetStartTask ¶
profiler for a Task.
type Task ¶
type Task interface { Run(ctx context.Context, commandContext *CommandContext) Task Name() string Checkpoint() *CompletedTask Restore(ctx context.Context, commandContext *CommandContext, completedTask *CompletedTask) (Task, error) }
Task is a logical unit of work - meant to be implemented by each Task.
type TaskCheckpoint ¶ added in v0.9.2
type TaskCheckpoint interface{}
type TaskRunnerOpt ¶ added in v0.11.0
type TaskRunnerOpt func(*taskRunner)
func WithCheckpointFile ¶ added in v0.11.0
func WithCheckpointFile() TaskRunnerOpt
Click to show internal directories.
Click to hide internal directories.