Documentation ¶
Index ¶
- func GetContainersWithStatusAndIsInit(pod *v1.Pod) ([]v1.Container, []v1.ContainerStatus, bool)
- func GetCurrentPod(kubeClient kubernetes.Interface, ns string) (*v1.Pod, error)
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodNames(client kubernetes.Interface, ns string, filter string) ([]string, error)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func GetPodRestarts(pod *v1.Pod) int32
- func GetPods(client kubernetes.Interface, ns string, filter string) ([]string, map[string]*v1.Pod, error)
- func GetPodsWithLabels(client kubernetes.Interface, ns string, selector string) ([]string, map[string]*v1.Pod, error)
- func GetReadyPodForSelector(client kubernetes.Interface, namespace string, selector string) (*corev1.Pod, error)
- func HasContainerStarted(pod *v1.Pod, idx int) bool
- func IsPodCompleted(pod *v1.Pod) bool
- func IsPodFailed(pod *v1.Pod) bool
- func IsPodPending(pod *v1.Pod) bool
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func IsPodSucceeded(pod *v1.Pod) bool
- func ListOptionsString(options metav1.ListOptions) string
- func PodStatus(pod *v1.Pod) string
- func WaitForPodNameToBeComplete(client kubernetes.Interface, namespace string, name string, ...) error
- func WaitForPodNameToBeReady(client kubernetes.Interface, namespace string, name string, ...) error
- func WaitForPodNameToBeRunning(client kubernetes.Interface, namespace string, name string, ...) error
- func WaitForPodSelectorToBeReady(client kubernetes.Interface, namespace string, selector string, ...) (*corev1.Pod, error)
- func WaitforPodNameCondition(client kubernetes.Interface, namespace string, name string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContainersWithStatusAndIsInit ¶
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 ¶
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 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 ¶
GetPodRestars returns the number of restarts of a POD
func GetPodsWithLabels ¶
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 ¶
HasContainerStarted returns true if the given Container has started running
func IsPodCompleted ¶
IsPodCompleted returns true if a pod is completed (succeeded or failed); false otherwise.
func IsPodFailed ¶ added in v3.0.46
IsPodFailed returns true if a pod is failed
func IsPodPending ¶ added in v3.0.48
IsPodPending returns true if a pod is pending
func IsPodReady ¶
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 ¶
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 ¶
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 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.