job

package
v0.0.0-...-a88c85e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kubeclient

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

Kubeclient enables kubernetes API operations on job instance

func NewKubeClient

func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeClient returns a new instance of kubeclient meant for job, caller can configure it with different kubeclientBuildOption

func (*Kubeclient) Create

func (k *Kubeclient) Create(job *batchv1.Job) (*batchv1.Job, error)

Create creates a job in specified namespace in kubernetes cluster

func (*Kubeclient) Delete

func (k *Kubeclient) Delete(name string, options *metav1.DeleteOptions) error

Delete returns job object for given name

func (*Kubeclient) Get

func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (
	*batchv1.Job, error)

Get returns job object for given name

func (*Kubeclient) GetRaw

func (k *Kubeclient) GetRaw(name string, opts metav1.GetOptions) (
	[]byte, error)

GetRaw returns job object for given name in byte format

func (*Kubeclient) List

func (k *Kubeclient) List(opts metav1.ListOptions) (
	*batchv1.JobList, error)

List returns list of jobs

func (*Kubeclient) ListRaw

func (k *Kubeclient) ListRaw(opts metav1.ListOptions) ([]byte, error)

ListRaw returns list of jobs in byte format

func (*Kubeclient) Patch

func (k *Kubeclient) Patch(
	name string,
	pt types.PatchType,
	data []byte,
	subresources ...string,
) (*batchv1.Job, error)

Patch patches job object for given name

func (*Kubeclient) WithNamespace

func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient

WithNamespace set namespace in kubeclient object

type KubeclientBuildOption

type KubeclientBuildOption func(*Kubeclient)

KubeclientBuildOption defines the abstraction to build a kubeclient instance

func WithClientset

func WithClientset(c *kubernetes.Clientset) KubeclientBuildOption

WithClientset sets the kubernetes client against the kubeclient instance

func WithKubeConfigPath

func WithKubeConfigPath(path string) KubeclientBuildOption

WithKubeConfigPath sets the kubeConfig path against client instance

func WithNamespace

func WithNamespace(namespace string) KubeclientBuildOption

WithNamespace set namespace in kubeclient object

Jump to

Keyboard shortcuts

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