job

package
v1.2.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobRetry   = 3
	JobTTL     = 60
	JobTimeout = 480
)

Default Job arguments to be used with NewJob.

Variables

This section is empty.

Functions

func NewHelloWorldJob

func NewHelloWorldJob(checkConnectivityCmd string) *batchv1.Job

func NewHelloWorldJobHTTP

func NewHelloWorldJobHTTP(host string, port string) *batchv1.Job

NewHelloWorldJobHTTP gets an IP address and a port, which it uses to create a pod. This pod tries to contact the host on the provided port, over HTTP. On success - it expects to receive "Hello World!".

func NewHelloWorldJobTCP

func NewHelloWorldJobTCP(host string, port string) *batchv1.Job

NewHelloWorldJob takes a DNS entry or an IP and a port which it will use to create a job which tries to contact the host on the provided port. It expects to receive "Hello World!" to succeed.

func NewHelloWorldJobUDP

func NewHelloWorldJobUDP(host, port string) *batchv1.Job

NewHelloWorldJobUDP takes a DNS entry or an IP and a port which it will use create a pod which tries to contact the host on the provided port. It expects to receive "Hello UDP World!" to succeed. Note that in case of UDP, the server will not see the connection unless something is sent over it However, netcat does not work well with UDP and closes before the answer arrives, we make netcat wait until the defined timeout is expired to prevent this from happening.

func WaitForJob

func WaitForJob(job *batchv1.Job, toSucceed bool, timeout time.Duration) error

func WaitForJobToFail

func WaitForJobToFail(job *batchv1.Job, timeout time.Duration) error

WaitForJobToFail blocks until the given job finishes. On failure, it returns with a nil error, on success or timeout it returns with an error.

func WaitForJobToSucceed

func WaitForJobToSucceed(job *batchv1.Job, timeout time.Duration) error

WaitForJobToSucceed blocks until the given job finishes. On success, it returns with a nil error, on failure or timeout it returns with an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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