jobs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package jobs provides implementation of Job resources for Kubernetes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobOptions

type JobOptions struct {
	Namespace     string
	Name          string
	NodeName      string
	Image         string
	PullPolicy    coreV1.PullPolicy
	Command       []string
	RestartPolicy coreV1.RestartPolicy
	Wait          string
	Autodelete    bool
}

JobOptions provide configuration settings for creation of Job resources

type Jobs

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

Jobs provides API for manipulating Job resources within a Kubernetes cluster

func New

func New(ctx context.Context, client kubernetes.Interface, metaOptions metav1.ListOptions) *Jobs

New creates a new instance backed by the provided client

func (*Jobs) Apply

func (obj *Jobs) Apply(yaml string, namespace string) (v1.Job, error)

Apply creates the Kubernetes resource given the supplied YAML configuration

func (*Jobs) Create

func (obj *Jobs) Create(options JobOptions) (v1.Job, error)

Create creates the Kubernetes resource given the supplied object

func (*Jobs) Delete

func (obj *Jobs) Delete(name, namespace string) error

Delete removes the named Job from the namespace

func (*Jobs) Get

func (obj *Jobs) Get(name, namespace string) (v1.Job, error)

Get returns the named Jobs instance within the namespace if available

func (*Jobs) Kill

func (obj *Jobs) Kill(name, namespace string) error

Kill removes the named Job from the namespace Deprecated: Use Delete instead.

func (*Jobs) List

func (obj *Jobs) List(namespace string) ([]v1.Job, error)

List returns a collection of Jobs available within the namespace

func (*Jobs) Wait

func (obj *Jobs) Wait(options WaitOptions) (bool, error)

Wait for all pods to complete

type WaitOptions

type WaitOptions struct {
	Name      string
	Namespace string
	Timeout   string
}

WaitOptions specify the options for waiting for a Job to complete

Jump to

Keyboard shortcuts

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