pods

package
v3.0.40 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 18 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainersWithStatusAndIsInit

func GetContainersWithStatusAndIsInit(pod *v1.Pod) ([]v1.Container, []v1.ContainerStatus, bool)

GetContainersWithStatusAndIsInit gets the containers in the pod, either init containers or non-init depending on whether non-init containers are present, and a flag as to whether this list of containers are init containers or not.

func GetCurrentPod

func GetCurrentPod(kubeClient kubernetes.Interface, ns string) (*v1.Pod, error)

GetCurrentPod returns the current pod the code is running in or nil if it cannot be deduced

func GetPodCondition

func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)

credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetPodNames

func GetPodNames(client kubernetes.Interface, ns string, filter string) ([]string, error)

func GetPodReadyCondition

func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition

credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go Extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.

func GetPodRestarts

func GetPodRestarts(pod *v1.Pod) int32

GetPodRestars returns the number of restarts of a POD

func GetPods

func GetPods(client kubernetes.Interface, ns string, filter string) ([]string, map[string]*v1.Pod, error)

func GetPodsWithLabels

func GetPodsWithLabels(client kubernetes.Interface, ns string, selector string) ([]string, map[string]*v1.Pod, error)

func GetReadyPodForSelector

func GetReadyPodForSelector(client kubernetes.Interface, namespace string, selector string) (*corev1.Pod, error)

GetReadyPodForSelector returns the first ready pod for the given selector or nil

func HasContainerStarted

func HasContainerStarted(pod *v1.Pod, idx int) bool

HasContainerStarted returns true if the given Container has started running

func IsPodCompleted

func IsPodCompleted(pod *v1.Pod) bool

IsPodCompleted returns true if a pod is completed (succeeded or failed); false otherwise.

func IsPodReady

func IsPodReady(pod *v1.Pod) bool

credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go IsPodReady returns true if a pod is ready; false otherwise.

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status v1.PodStatus) bool

credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go IsPodReady retruns true if a pod is ready; false otherwise.

func IsPodSucceeded

func IsPodSucceeded(pod *v1.Pod) bool

IsPodSucceeded returns true if a pod is succeeded

func ListOptionsString

func ListOptionsString(options metav1.ListOptions) string

ListOptionsString returns a string summary of the list options

func PodStatus

func PodStatus(pod *v1.Pod) string

func WaitForPodNameToBeComplete

func WaitForPodNameToBeComplete(client kubernetes.Interface, namespace string, name string,
	timeout time.Duration) error

WaitForPodNameToBeComplete waits for the pod to complete (succeed or fail) using the pod name

func WaitForPodNameToBeReady

func WaitForPodNameToBeReady(client kubernetes.Interface, namespace string, name string, timeout time.Duration) error

WaitForPodNameToBeReady waits for the pod with the given name to become ready

func WaitForPodNameToBeRunning added in v3.0.17

func WaitForPodNameToBeRunning(client kubernetes.Interface, namespace string, name string, timeout time.Duration) error

WaitForPodNameToBeRunning waits for the pod with the given name to be running

func WaitForPodSelectorToBeReady

func WaitForPodSelectorToBeReady(client kubernetes.Interface, namespace string, selector string, timeout time.Duration) (*corev1.Pod, error)

WaitForPodSelectorToBeReady waits for the pod to become ready using the given selector name

func WaitforPodNameCondition added in v3.0.17

func WaitforPodNameCondition(client kubernetes.Interface, namespace string, name string, timeout time.Duration, condition func(pod *corev1.Pod) (bool, error)) error

WaitforPodNameCondition waits for the given pod name to match the given condition function

Types

This section is empty.

Jump to

Keyboard shortcuts

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