kubeclient

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMockClient

func CreateMockClient(
	nodesJsonFilePath string,
	namespacesJsonFilePath string,
	podsJsonFilePath string,
	rsJsonFilePath string,
	eventsFilePath string,
) (*mockKubernetesClient, error)

func GetEvents

func GetEvents(t *testing.T, fileName string) ([]v1.Event, error)

func GetNamespaces

func GetNamespaces(t *testing.T, fileName string) ([]v1.Namespace, error)

func GetNodes

func GetNodes(t *testing.T, fileName string) ([]v1.Node, error)

func GetPods

func GetPods(t *testing.T, fileName string) ([]v1.Pod, error)

func GetReplicaSets

func GetReplicaSets(t *testing.T, fileName string) ([]v12.ReplicaSet, error)

Types

type KubernetesClient

type KubernetesClient interface {
	GetNodes() ([]v1.Node, error)
	GetNamespaces() ([]v1.Namespace, error)
	GetPods(namespace string) ([]v1.Pod, error)
	GetReplicaSets(namespace string) ([]v12.ReplicaSet, error)
	GetPodLogs(namespace string, podName string, containerName string) (logs string, err error)
	GetEvents(namespace string) ([]v1.Event, error)
}

func CreateClient

func CreateClient(config *config.Config, kubeconfig kubeconfig.KubeConfig) (KubernetesClient, error)

Jump to

Keyboard shortcuts

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