kubernetes

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesWorker

type KubernetesWorker struct {
	// contains filtered or unexported fields
}

KubernetesWorker represents a container executor. It has a lifetime of a single command execution.

func New

func New(command data.CommandRequest, token rest.Token) (*KubernetesWorker, error)

New will build and returns a new Worker for a single command execution.

func (*KubernetesWorker) Start

func (w *KubernetesWorker) Start(ctx context.Context) (<-chan string, error)

Start triggers a worker to run a Kubernetes Job. It returns a string channel that emits the container's combined stdout and stderr streams.

func (*KubernetesWorker) Stop

func (w *KubernetesWorker) Stop(ctx context.Context, timeout *time.Duration)

Stop will stop (if it's not already stopped) a worker process and clean up any resources it's using. If the worker fails to stop gracefully within a timeframe specified by the timeout argument, it is forcefully terminated (killed). If the timeout is nil, the engine's default is used. A negative timeout indicates no timeout: no forceful termination is performed.

func (*KubernetesWorker) Stopped

func (w *KubernetesWorker) Stopped() <-chan int64

Stopped returns a channel that blocks until this worker's container has stopped. The value emitted is the exit status code of the underlying process.

Jump to

Keyboard shortcuts

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