client

package
v0.0.0-...-914315b Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReadyStatus is the ready status of a pod.
	ReadyStatus = "Ready"
	// TRUE is a string for true.
	TRUE = "True"
	// FALSE is a string for false.
	FALSE = "False"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// ClientSet is a kubernetes clientset.
	ClientSet *kubernetes.Clientset
	// DynamicClient is a dynamic client.
	DynamicClient *dynamic.DynamicClient
}

Client is a kubernetes client.

func NewK8sClient

func NewK8sClient() (*Client, error)

NewK8sClient creates a new kubernetes client.

func (*Client) CheckAllPodsReady

func (c *Client) CheckAllPodsReady() (bool, error)

CheckAllPodsReady checks if all pods are ready.

func (*Client) CreateNamespace

func (c *Client) CreateNamespace(name string) error

CreateNamespace creates a namespace.

func (*Client) DeleteNamespace

func (c *Client) DeleteNamespace(name string) error

DeleteNamespace deletes a namespace.

func (*Client) GetNotReadyPodEvent

func (c *Client) GetNotReadyPodEvent() (map[string][]EventPod, error)

GetNotReadyPodEvent returns the events of not ready pods.

func (*Client) GetPodEvents

func (c *Client) GetPodEvents(namespace, podName string) ([]v1.Event, error)

GetPodEvents returns the events of a pod.

func (*Client) GetPodLog

func (c *Client) GetPodLog(namespace, podName string) (string, error)

GetPodLog returns the log of a pod.

func (*Client) ListAllNamespacesPods

func (c *Client) ListAllNamespacesPods() ([]*NamespacePod, error)

ListAllNamespacesPods returns a list of all namespaces and pods.

func (*Client) OutputNotReadyPodInfo

func (c *Client) OutputNotReadyPodInfo() error

OutputNotReadyPodInfo outputs the events of not ready pods.

func (*Client) WaitAllPodRunning

func (c *Client) WaitAllPodRunning() error

WaitAllPodRunning waits for all pods to be ready

type EventPod

type EventPod struct {
	// Reason is the reason this event was generated.
	Reason string
	// Message is a human-readable description of the status of this operation.
	Message string
	// Count is the number of times this event has occurred.
	Count int32
	// Type of this event
	Type string
	// Action is what action was taken/failed regarding to the Regarding object.
	Action string
	// Namespace is the namespace this event applies to.
	Namespace string
}

EventPod contains events of a pod.

type NamespacePod

type NamespacePod struct {
	// Namespace object
	Namespace v1.Namespace
	// PodList is a list of Pods.
	PodList *v1.PodList
}

NamespacePod is a namespace and its pods.

Jump to

Keyboard shortcuts

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