client

package
v0.0.0-...-db62745 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package client wraps the k8s client. Useful for mocking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

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

func NewEvent

func NewEvent(clientSet kubernetes.Interface) *Event

func (*Event) Create

func (c *Event) Create(ctx context.Context, namespace string, event *corev1.Event) (*corev1.Event, error)

func (*Event) GetByPod

func (c *Event) GetByPod(ctx context.Context, pod corev1.Pod) ([]corev1.Event, error)

func (*Event) Update

func (c *Event) Update(ctx context.Context, namespace string, event *corev1.Event) (*corev1.Event, error)

type Job

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

func NewJob

func NewJob(clientSet kubernetes.Interface, workloadsNamespace string) *Job

func (*Job) Create

func (c *Job) Create(ctx context.Context, namespace string, job *batchv1.Job) (*batchv1.Job, error)

func (*Job) Delete

func (c *Job) Delete(ctx context.Context, namespace string, name string) error

func (*Job) GetByGUID

func (c *Job) GetByGUID(ctx context.Context, guid string, includeCompleted bool) ([]batchv1.Job, error)

func (*Job) List

func (c *Job) List(ctx context.Context, includeCompleted bool) ([]batchv1.Job, error)

func (*Job) SetAnnotation

func (c *Job) SetAnnotation(ctx context.Context, job *batchv1.Job, key, value string) (*batchv1.Job, error)

func (*Job) SetLabel

func (c *Job) SetLabel(ctx context.Context, job *batchv1.Job, label, value string) (*batchv1.Job, error)

type Pod

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

func NewPod

func NewPod(clientSet kubernetes.Interface, workloadsNamespace string) *Pod

func (*Pod) Delete

func (c *Pod) Delete(ctx context.Context, namespace, name string) error

func (*Pod) GetAll

func (c *Pod) GetAll(ctx context.Context) ([]corev1.Pod, error)

func (*Pod) GetByLRPIdentifier

func (c *Pod) GetByLRPIdentifier(ctx context.Context, id api.LRPIdentifier) ([]corev1.Pod, error)

func (*Pod) SetAndTestAnnotation

func (c *Pod) SetAndTestAnnotation(ctx context.Context, pod *corev1.Pod, key, value string, oldValue *string) (*corev1.Pod, error)

func (*Pod) SetAnnotation

func (c *Pod) SetAnnotation(ctx context.Context, pod *corev1.Pod, key, value string) (*corev1.Pod, error)

type PodDisruptionBudget

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

func NewPodDisruptionBudget

func NewPodDisruptionBudget(clientSet kubernetes.Interface) *PodDisruptionBudget

func (*PodDisruptionBudget) Create

func (*PodDisruptionBudget) Delete

func (c *PodDisruptionBudget) Delete(ctx context.Context, namespace string, name string) error

func (*PodDisruptionBudget) Get

type Secret

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

func NewSecret

func NewSecret(clientSet kubernetes.Interface) *Secret

func (*Secret) Create

func (c *Secret) Create(ctx context.Context, namespace string, secret *corev1.Secret) (*corev1.Secret, error)

func (*Secret) Delete

func (c *Secret) Delete(ctx context.Context, namespace string, name string) error

func (*Secret) Get

func (c *Secret) Get(ctx context.Context, namespace, name string) (*corev1.Secret, error)

func (*Secret) SetOwner

func (c *Secret) SetOwner(ctx context.Context, secret *corev1.Secret, owner metav1.Object) (*corev1.Secret, error)

func (*Secret) Update

func (c *Secret) Update(ctx context.Context, namespace string, secret *corev1.Secret) (*corev1.Secret, error)

type StatefulSet

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

func NewStatefulSet

func NewStatefulSet(clientSet kubernetes.Interface, workloadsNamespace string) *StatefulSet

func (*StatefulSet) Create

func (c *StatefulSet) Create(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) (*appsv1.StatefulSet, error)

func (*StatefulSet) Delete

func (c *StatefulSet) Delete(ctx context.Context, namespace string, name string) error

func (*StatefulSet) Get

func (c *StatefulSet) Get(ctx context.Context, namespace, name string) (*appsv1.StatefulSet, error)

func (*StatefulSet) GetByLRPIdentifier

func (c *StatefulSet) GetByLRPIdentifier(ctx context.Context, id api.LRPIdentifier) ([]appsv1.StatefulSet, error)

func (*StatefulSet) GetBySourceType

func (c *StatefulSet) GetBySourceType(ctx context.Context, sourceType string) ([]appsv1.StatefulSet, error)

func (*StatefulSet) SetAnnotation

func (c *StatefulSet) SetAnnotation(ctx context.Context, statefulSet *appsv1.StatefulSet, key, value string) (*appsv1.StatefulSet, error)

func (*StatefulSet) SetCPURequest

func (c *StatefulSet) SetCPURequest(ctx context.Context, statefulSet *appsv1.StatefulSet, cpuRequest *resource.Quantity) (*appsv1.StatefulSet, error)

func (*StatefulSet) Update

func (c *StatefulSet) Update(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) (*appsv1.StatefulSet, error)

Jump to

Keyboard shortcuts

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