Help us shape the future of Go! Take the 2026 Go Developer Survey

spawner

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobSpawner

type JobSpawner interface {
	// SpawnJob creates a K8s Job for the task and returns the job name.
	// Returns the job name even when the job already exists (idempotent).
	SpawnJob(ctx context.Context, task lib.Task, config pkg.AgentConfiguration) (string, error)
	// IsJobActive returns true if an active (not completed/failed) K8s Job exists
	// for the given task identifier. Uses the agent.benjamin-borbe.de/task-id
	// label set by SpawnJob.
	IsJobActive(ctx context.Context, taskIdentifier lib.TaskIdentifier) (bool, error)
}

JobSpawner creates a K8s Job for a task.

func NewJobSpawner

func NewJobSpawner(
	kubeClient kubernetes.Interface,
	namespace k8s.Namespace,
	kafkaBrokers string,
	branch string,
	topicPrefix string,
	currentDateTimeGetter libtime.CurrentDateTimeGetter,
	jobTTLSecondsAfterFinished int32,
	jobKafkaClientCertSecret string,
	jobKafkaCaCertSecret string,
) JobSpawner

NewJobSpawner creates a new JobSpawner backed by the K8s batch/v1 API. jobTTLSecondsAfterFinished controls how long completed Job pods survive before Kubernetes' TTL controller garbage-collects them. jobKafkaClientCertSecret and jobKafkaCaCertSecret are the names of K8s secrets to mount into spawned Jobs for Kafka mTLS; empty strings mean no cert mounting.

Jump to

Keyboard shortcuts

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