spawner

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: BSD-2-Clause Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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,
) 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.

Jump to

Keyboard shortcuts

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