Documentation
¶
Index ¶
- func BuildOutputUri(ctx context.Context, ta *executorv1.TaskAction) string
- func GetPhaseFromConditions(taskAction *executorv1.TaskAction) common.ActionPhase
- func InitScheme() error
- func SignalValueFromStatus(ctx context.Context, taskAction *executorv1.TaskAction) *core.Literal
- type ActionUpdate
- type ActionsClient
- func (c *ActionsClient) AbortAction(ctx context.Context, actionID *common.ActionIdentifier, reason *string) error
- func (c *ActionsClient) Enqueue(ctx context.Context, action *actions.Action, runSpec *task.RunSpec) error
- func (c *ActionsClient) GetTaskAction(ctx context.Context, actionID *common.ActionIdentifier) (*executorv1.TaskAction, error)
- func (c *ActionsClient) ListChildActions(ctx context.Context, parentActionID *common.ActionIdentifier) ([]*executorv1.TaskAction, error)
- func (c *ActionsClient) ListRunActions(ctx context.Context, runID *common.RunIdentifier) ([]*executorv1.TaskAction, error)
- func (c *ActionsClient) PutStatus(ctx context.Context, actionID *common.ActionIdentifier, attempt uint32, ...) error
- func (c *ActionsClient) Signal(ctx context.Context, actionID *common.ActionIdentifier, value *core.Literal, ...) error
- func (c *ActionsClient) StartWatching(ctx context.Context) error
- func (c *ActionsClient) StopWatching()
- func (c *ActionsClient) Subscribe(runName, parentActionName string) chan *ActionUpdate
- func (c *ActionsClient) Unsubscribe(runName, parentActionName string, ch chan *ActionUpdate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOutputUri ¶ added in v2.0.28
func BuildOutputUri(ctx context.Context, ta *executorv1.TaskAction) string
BuildOutputUri computes the action-specific output URI from the TaskAction spec. It uses the same path structure as the executor's ComputeActionOutputPath so that the SDK can find outputs written by the executor.
func GetPhaseFromConditions ¶
func GetPhaseFromConditions(taskAction *executorv1.TaskAction) common.ActionPhase
GetPhaseFromConditions extracts the phase from TaskAction conditions.
func SignalValueFromStatus ¶ added in v2.0.28
func SignalValueFromStatus(ctx context.Context, taskAction *executorv1.TaskAction) *core.Literal
SignalValueFromStatus unmarshals the condition signal value persisted on the CR status. Returns nil when absent (tasks, unsignalled conditions) or invalid.
Types ¶
type ActionUpdate ¶
type ActionUpdate struct {
ActionID *common.ActionIdentifier
ParentActionName string
StateJSON string
Phase common.ActionPhase
OutputUri string
IsDeleted bool
TaskType string
ShortName string
ErrorState *executorv1.ErrorState
// SignalValue is the resolved signal payload of a condition action, carried
// inline (never an outputs.pb). Nil for tasks and unsignalled conditions.
SignalValue *core.Literal
}
ActionUpdate represents an update to a TaskAction
type ActionsClient ¶
type ActionsClient struct {
// contains filtered or unexported fields
}
ActionsClient handles all etcd/K8s TaskAction CR operations for the Actions service.
func NewActionsClient ¶
func NewActionsClient(k8sClient client.WithWatch, sharedCache ctrlcache.Cache, namespace string, bufferSize int, numWorkers int, runClient workflowconnect.InternalRunServiceClient, recordFilterSize int, scope promutils.Scope) (*ActionsClient, error)
NewActionsClient creates a new Kubernetes-based actions client.
func (*ActionsClient) AbortAction ¶
func (c *ActionsClient) AbortAction(ctx context.Context, actionID *common.ActionIdentifier, reason *string) error
AbortAction deletes a TaskAction CR from etcd. K8s cascades the deletion to all descendants via OwnerReferences.
func (*ActionsClient) Enqueue ¶
func (c *ActionsClient) Enqueue(ctx context.Context, action *actions.Action, runSpec *task.RunSpec) error
Enqueue creates a TaskAction CR in etcd (via the K8s API).
func (*ActionsClient) GetTaskAction ¶
func (c *ActionsClient) GetTaskAction(ctx context.Context, actionID *common.ActionIdentifier) (*executorv1.TaskAction, error)
GetTaskAction retrieves a specific TaskAction
func (*ActionsClient) ListChildActions ¶
func (c *ActionsClient) ListChildActions(ctx context.Context, parentActionID *common.ActionIdentifier) ([]*executorv1.TaskAction, error)
ListChildActions lists all TaskActions that are children of the given parent action
func (*ActionsClient) ListRunActions ¶
func (c *ActionsClient) ListRunActions(ctx context.Context, runID *common.RunIdentifier) ([]*executorv1.TaskAction, error)
ListRunActions lists all TaskActions belonging to a run.
func (*ActionsClient) PutStatus ¶ added in v2.0.21
func (c *ActionsClient) PutStatus(ctx context.Context, actionID *common.ActionIdentifier, attempt uint32, status *workflow.ActionStatus) error
PutStatus updates the latest attempt metadata for a TaskAction.
func (*ActionsClient) Signal ¶ added in v2.0.28
func (c *ActionsClient) Signal(ctx context.Context, actionID *common.ActionIdentifier, value *core.Literal, signalledBy string) error
Signal delivers the resolved value to a paused condition action by writing status.signalValue/signalledBy/signalledAt. The reconciler is the single writer of status.conditions[] and flips the CR to Succeeded when it observes the value, so validation here is synchronous but the transition is not.
func (*ActionsClient) StartWatching ¶
func (c *ActionsClient) StartWatching(ctx context.Context) error
StartWatching starts watching TaskAction resources and notifies all subscribers. It requires a shared controller-runtime cache.
func (*ActionsClient) StopWatching ¶
func (c *ActionsClient) StopWatching()
StopWatching stops the TaskAction watcher
func (*ActionsClient) Subscribe ¶
func (c *ActionsClient) Subscribe(runName, parentActionName string) chan *ActionUpdate
func (*ActionsClient) Unsubscribe ¶
func (c *ActionsClient) Unsubscribe(runName, parentActionName string, ch chan *ActionUpdate)
Unsubscribe removes the given channel from the subscription list for the (run, parent action)