k8s

package
v2.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

Types

type ActionUpdate

type ActionUpdate struct {
	ActionID         *common.ActionIdentifier
	ParentActionName string
	StateJSON        string
	Phase            common.ActionPhase
	OutputUri        string
	IsDeleted        bool
	TaskType         string
	ShortName        string
}

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

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) GetState

func (c *ActionsClient) GetState(ctx context.Context, actionID *common.ActionIdentifier) (string, error)

GetState retrieves the state JSON for a TaskAction

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) PutState

func (c *ActionsClient) PutState(ctx context.Context, actionID *common.ActionIdentifier, attempt uint32, status *workflow.ActionStatus, stateJSON string) error

PutState updates the state JSON and latest attempt metadata for a TaskAction.

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(parentActionName string) chan *ActionUpdate

Subscribe creates a new subscription channel for action updates for specified parent action name

func (*ActionsClient) Unsubscribe

func (c *ActionsClient) Unsubscribe(parentActionName string, ch chan *ActionUpdate)

Unsubscribe removes the given channel from the subscription list for the parent action name

Jump to

Keyboard shortcuts

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