k8s

package
v2.0.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

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 InitScheme

func InitScheme() error

InitScheme adds the executor API types to the scheme

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL