Documentation ¶
Index ¶
- Constants
- func NewHelloWorldJob(checkConnectivityCmd string) *batchv1.Job
- func NewHelloWorldJobHTTP(host string, port string) *batchv1.Job
- func NewHelloWorldJobTCP(host string, port string) *batchv1.Job
- func NewHelloWorldJobUDP(host, port string) *batchv1.Job
- func WaitForJob(job *batchv1.Job, toSucceed bool, timeout time.Duration) error
- func WaitForJobToFail(job *batchv1.Job, timeout time.Duration) error
- func WaitForJobToSucceed(job *batchv1.Job, timeout time.Duration) error
Constants ¶
const ( JobRetry = 3 JobTTL = 60 JobTimeout = 480 )
Default Job arguments to be used with NewJob.
Variables ¶
This section is empty.
Functions ¶
func NewHelloWorldJob ¶
func NewHelloWorldJobHTTP ¶
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 ¶
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 ¶
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 WaitForJobToFail ¶
WaitForJobToFail blocks until the given job finishes. On failure, it returns with a nil error, on success or timeout it returns with an error.
Types ¶
This section is empty.