k8sclient

package
Version: v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FakeClient = &FakeK8sClient{
	PodMap: make(map[string]*corev1.Pod),
	lock:   sync.RWMutex{},
}

Functions

This section is empty.

Types

type FakeK8sClient

type FakeK8sClient struct {
	PodMap map[string]*corev1.Pod
	// contains filtered or unexported fields
}

FakeK8sClient creates a new mock k8s client used for testing

func (*FakeK8sClient) CreatePod

func (f *FakeK8sClient) CreatePod(pod *corev1.Pod) (*corev1.Pod, error)

func (*FakeK8sClient) DeletePod

func (f *FakeK8sClient) DeletePod(pod *corev1.Pod) error

func (*FakeK8sClient) Flush

func (f *FakeK8sClient) Flush()

func (*FakeK8sClient) GetPod

func (f *FakeK8sClient) GetPod(podName, namespace string) (*corev1.Pod, error)

func (*FakeK8sClient) PatchPod

func (f *FakeK8sClient) PatchPod(pod *corev1.Pod, data []byte) error

func (*FakeK8sClient) UpdatePod

func (f *FakeK8sClient) UpdatePod(pod *corev1.Pod) error

type K8sClient

type K8sClient interface {
	CreatePod(pod *corev1.Pod) (*corev1.Pod, error)
	GetPod(podName, namespace string) (*corev1.Pod, error)
	PatchPod(pod *corev1.Pod, data []byte) error
	UpdatePod(pod *corev1.Pod) error
	DeletePod(pod *corev1.Pod) error
}

func NewClient

func NewClient() (K8sClient, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL