controller

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package controller lets a wrapper binary embed the worker-deployment controller and run it with custom Temporal client configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedClient

type CachedClient = clientpool.CachedClient

CachedClient is a Temporal SDK client paired with a validity check. IsValid is called on every cache hit. A false result triggers eviction and re-dial.

type Controller

Controller reconciles WorkerDeployment resources.

func New

func New(mgr ctrl.Manager, opts ...Option) (*Controller, error)

New returns a Controller wired with the given manager, or an error if the options are misconfigured (e.g. both WithCreateClient and WithDefaultClient). The manager supplies the Kubernetes client, scheme, and event recorder; the Temporal client pool is built internally from the manager's client.

type CreateClientFunc

type CreateClientFunc = clientpool.CreateClientFunc

CreateClientFunc creates a Temporal SDK client for a connection spec: secret parsing, options, dialing, and health check. The pool caches the returned CachedClient.

type CustomizeClientOptionsFunc

type CustomizeClientOptionsFunc func(sdkclient.Options) sdkclient.Options

CustomizeClientOptionsFunc mutates SDK client options before dialing. It only applies to the default client-creation path (WithDefaultClient).

type Option

type Option func(*config)

Option configures a controller built by New.

func WithCreateClient

func WithCreateClient(fn CreateClientFunc) Option

WithCreateClient overrides the default client-creation path. The function owns the full construction: secret parsing, options, dialing, and health check.

func WithDefaultClient

func WithDefaultClient(customize ...CustomizeClientOptionsFunc) Option

WithDefaultClient uses the built-in client-creation path (parse Secret, build options, dial, health-check). Accepts optional CustomizeClientOptions to mutate SDK options before dialing.

func WithDisableClusterConnections

func WithDisableClusterConnections(disable bool) Option

WithDisableClusterConnections drops ClusterConnection support. Set when the manager is namespace-scoped (a namespaced Role cannot list the cluster-scoped ClusterConnection CRD).

func WithDisableDeprecatedTWD

func WithDisableDeprecatedTWD(disable bool) Option

WithDisableDeprecatedTWD disables watching the deprecated TemporalWorkerDeployment CRD. Set when the CRD is not installed.

func WithDisableRecoverPanic

func WithDisableRecoverPanic(disable bool) Option

WithDisableRecoverPanic disables panic recovery in the reconciler.

func WithLogger

func WithLogger(l log.Logger) Option

WithLogger sets the logger used by the internally-built client pool.

func WithMaxDeploymentVersionsIneligibleForDeletion

func WithMaxDeploymentVersionsIneligibleForDeletion(n int32) Option

WithMaxDeploymentVersionsIneligibleForDeletion sets the cap on how many worker deployment versions may be ineligible for deletion before the controller stops deploying new versions. When unset, the built-in default is used.

func WithWRTHPAMatchLabelsStripTemporalPrefix

func WithWRTHPAMatchLabelsStripTemporalPrefix(strip bool) Option

WithWRTHPAMatchLabelsStripTemporalPrefix sets whether to strip the "temporal_" prefix from auto-injected WorkerResourceTemplate HPA external metric matchLabels.

Jump to

Keyboard shortcuts

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