Documentation ¶
Index ¶
- type Config
- type Duration
- type Executor
- func (js *Executor) GetKnownJobs() (jobs []pirov1.JobStatus, err error)
- func (js *Executor) Logs(name string) io.Reader
- func (js *Executor) RegisterResult(jobname string, res *pirov1.JobResult) error
- func (js *Executor) Run()
- func (js *Executor) Start(podspec corev1.PodSpec, metadata pirov1.JobMetadata, options ...StartOpt) (status *pirov1.JobStatus, err error)
- func (js *Executor) Stop(name, reason string) error
- type StartOpt
- func WithAnnotation(key, value string) StartOpt
- func WithAnnotations(annotations map[string]string) StartOpt
- func WithBackoff(limit int) StartOpt
- func WithCanReplay(canReplay bool) StartOpt
- func WithMutex(name string) StartOpt
- func WithName(name string) StartOpt
- func WithSidecars(names []string) StartOpt
- func WithWaitUntil(t time.Time) StartOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Namespace string `yaml:"namespace"` EventTraceLog string `yaml:"eventTraceLog,omitempty"` JobPrepTimeout *Duration `yaml:"preperationTimeout"` JobTotalTimeout *Duration `yaml:"totalTimeout"` LabelPrefix string `json:"labelPrefix"` }
Config configures the executor
type Duration ¶
Duration is a JSON un-/marshallable type
func (*Duration) UnmarshalYAML ¶
UnmarshalYAML parses a duration from its JSON representation
type Executor ¶
type Executor struct { // OnUpdate is called when the status of a Kubernetes Job changes. // Beware: this function can be called several times with the same status. OnUpdate func(pod *corev1.Pod, status *pirov1.JobStatus) Client kubernetes.Interface Config Config KubeConfig *rest.Config // contains filtered or unexported fields }
Executor starts and watches jobs running in Kubernetes
func NewExecutor ¶
NewExecutor creates a new job center instance
func (*Executor) GetKnownJobs ¶
GetKnownJobs returns a list of all Kubernetes Job(s) the executor knows about
func (*Executor) Logs ¶
Logs provides the log output of a running Job. If the job is unknown, nil is returned.
func (*Executor) RegisterResult ¶
RegisterResult registers a result produced by a Kubernetes Job
type StartOpt ¶
type StartOpt func(*startOptions)
StartOpt configures a Kubernetes Job at startup
func WithAnnotation ¶
WithAnnotation sets a single annotation on a Kubernetes Job
func WithAnnotations ¶
WithAnnotations sets all annotations of a Kubernetes Job
func WithBackoff ¶
WithBackoff configures the backoff behaviour of a Kubernetes Job
func WithCanReplay ¶
WithCanReplay configures the if the Kubernetes Job can be replayed
func WithMutex ¶
WithMutex starts a Kubernetes Job with a mutex (i.e. cancels all other Jobs with that mutex)
func WithSidecars ¶
WithSidecars makes some containers dependent on the lifecycle of others
func WithWaitUntil ¶
WithWaitUntil starts the execution of a Kubernetes Job at some later point