Skip to main content

Setup

Registers the ActionsService handler on the SetupContext mux. This function requires sc.K8sClient and sc.Namespace to be set.

def Setup(
ctx: context.Context,
sc: *app.SetupContext
) - > error

Registers the ActionsService handler on the SetupContext mux. This function initializes OpenTelemetry providers and interceptors, sets up the Kubernetes client for actions, starts watching for TaskAction resources, and mounts the ActionsService handler to the provided multiplexer. It requires sc.K8sClient and sc.Namespace to be set.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for cancellation and carrying request-scoped values.
sc*app.SetupContextThe setup context containing necessary components like the Kubernetes client, cache, base URL, and the multiplexer to register the service handler. It must have K8sClient and Namespace initialized.

Returns

TypeDescription
errorAn error if any step of the setup process fails, such as registering OpenTelemetry providers, initializing the Kubernetes scheme, creating the OpenTelemetry interceptor, or starting the TaskAction watcher.