{"modulePath":"github.com/flyteorg/flyte/v2","version":"v2.0.57","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controller\n\n## Constants\n\n```go\nconst (\n\tTaskActionDefaultRequeueDuration = 10 * time.Second\n\n\t// DefaultMaxSystemFailures bounds the system errors one attempt may take\n\t// before the TaskAction is forced to PermanentFailure.\n\tDefaultMaxSystemFailures uint32 = 3\n\n\t// MaxSystemFailuresExceededCode is the ExecutionError.Code stamped on\n\t// TaskActions that hit the system-failure ceiling.\n\tMaxSystemFailuresExceededCode = \"MaxSystemFailuresExceeded\"\n\n\t// TaskExecutionTimedOutCode is the stable ExecutionError.Code for a task\n\t// attempt that exhausts its configured max runtime.\n\tTaskExecutionTimedOutCode = \"TaskExecutionTimedOut\"\n\n\t// TaskDeadlineExceededCode is the stable ExecutionError.Code for an action\n\t// that does not finish within its deadline across all attempts. The SDKs map\n\t// it to their deadline-exceeded error.\n\tTaskDeadlineExceededCode = \"DEADLINE_EXCEEDED\"\n\n\t// LabelTerminationStatus marks a TaskAction as terminated for GC discovery.\n\tLabelTerminationStatus = \"flyte.org/termination-status\"\n\t// LabelCompletedTime records the UTC time (minute precision) when the TaskAction became terminal.\n\tLabelCompletedTime = \"flyte.org/completed-time\"\n\t// LabelValueTerminated is the value for LabelTerminationStatus.\n\tLabelValueTerminated = \"terminated\"\n)\n```\n\n```go\nconst ConditionTimedOutCode = \"ConditionTimedOut\"\n```\nConditionTimedOutCode is the ErrorState.Code stamped on condition actions that pass their deadline without being signalled.\n\n## Types\n\n```go\ntype GarbageCollector struct {\n\t// contains filtered or unexported fields\n}\n```\nGarbageCollector periodically deletes terminal TaskActions that have exceeded their TTL. It implements the controller-runtime manager.Runnable interface.\n\n```go\nfunc NewGarbageCollector(c client.Client, reader client.Reader, interval, maxTTL time.Duration, provider metric.MeterProvider) *GarbageCollector\n```\nNewGarbageCollector creates a new GarbageCollector. reader must be an uncached reader (e.g. mgr.GetAPIReader()): collect() lists with Continue pagination, which the controller-runtime cache does not support (\"continue list option is not supported by the cache\"). client is used for the deletes. provider is the executor's OTel meter provider (otelutils.GetMeterProvider(otelServiceName) in executor/setup.go).\n\n```go\nfunc (gc *GarbageCollector) Start(ctx context.Context) error\n```\nStart runs the garbage collection loop until the context is cancelled. It satisfies the manager.Runnable interface.\n\n```go\ntype K8sEventType string\n```\n\n```go\nconst (\n\tFailedUnmarshal     K8sEventType = \"FailedUnmarshal\"\n\tFailedValidation    K8sEventType = \"FailedValidation\"\n\tFailedPluginResolve K8sEventType = \"FailedPluginResolve\"\n\tFailedPluginHandle  K8sEventType = \"FailedPluginHandle\"\n)\n```\n\n```go\ntype TaskActionReconciler struct {\n\tclient.Client\n\tScheme          *runtime.Scheme\n\tRecorder        events.EventRecorder\n\tPluginRegistry  *plugin.Registry\n\tDataStore       *storage.DataStore\n\tSecretManager   pluginsCore.SecretManager\n\tResourceManager pluginsCore.ResourceManager\n\tCatalogClient   catalog.AsyncClient\n\tCatalog         catalog.Client\n\n\tMaxSystemFailures uint32\n\t// RequeueDuration overrides how long to wait before reconciling a running\n\t// TaskAction again. Any non-positive value means TaskActionDefaultRequeueDuration.\n\tRequeueDuration time.Duration\n\tClock           clock.Clock\n\t// contains filtered or unexported fields\n}\n```\nTaskActionReconciler reconciles a TaskAction object\n\n```go\nfunc NewTaskActionReconciler(\n\tc client.Client,\n\tscheme *runtime.Scheme,\n\tregistry *plugin.Registry,\n\tdataStore *storage.DataStore,\n\teventsClient workflowconnect.EventsProxyServiceClient,\n\tcluster string,\n\tmeterProvider metric.MeterProvider,\n\tcache ctrlcache.Cache,\n) *TaskActionReconciler\n```\nNewTaskActionReconciler creates a new TaskActionReconciler. meterProvider is the executor's OTel meter provider (otelutils.GetMeterProvider(otelServiceName) in executor/setup.go). cache is the manager's cache (mgr.GetCache()); the active-by-phase gauge counts TaskActions straight from its indexer to avoid deep-copying every CRD. TaskAction CRD operations are timed inline at the call sites via metrics.recordK8sOp.\n\n```go\nfunc (r *TaskActionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)\n```\nReconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.\n\n```go\nfunc (r *TaskActionReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles int) error\n```\nSetupWithManager sets up the controller with the Manager.\n\n","path":"github.com/flyteorg/flyte/v2/executor/pkg/controller","name":"controller","synopsis":"","isRedistributable":true}
