Documentation ¶
Index ¶
- func ExecCmd(client kubernetes.Interface, config *restclient.Config, podName, ns string, ...) (string, string, error)
- func GetContainersWithStatusAndIsInit(pod *v1.Pod) ([]v1.Container, []v1.ContainerStatus, bool)
- func GetCurrentPod(kubeClient kubernetes.Interface, ns string) (*v1.Pod, error)
- func GetFirstPodForService(client kubernetes.Interface, svc *v1.Service, namespace 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 GetRunningPodForSelector(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 IsPodRunning(pod *corev1.Pod) bool
- func IsPodSucceeded(pod *v1.Pod) bool
- func ListOptionsString(options *metav1.ListOptions) string
- func PodStatus(pod *v1.Pod) string
- func WaitForPod(client kubernetes.Interface, namespace string, ...) (*v1.Pod, error)
- 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
- type PodPredicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCmd ¶ added in v3.0.81
func ExecCmd(client kubernetes.Interface, config *restclient.Config, podName, ns string, command string) (string, string, error)
ExecCmd exec command on specific pod and wait the command's output.
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 just init containers or not.
func GetCurrentPod ¶
GetCurrentPod returns the current pod the code is running in or nil if it cannot be deduced
func GetFirstPodForService ¶ added in v3.0.81
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
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. credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go
func GetPodNames ¶
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
GetPodReadyCondition Extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present. credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go
func GetPodRestarts ¶
GetPodRestarts 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 GetRunningPodForSelector ¶ added in v3.0.89
func GetRunningPodForSelector(client kubernetes.Interface, namespace string, selector string) (*corev1.Pod, error)
GetRunningPodForSelector returns the first pod running 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 ¶
IsPodReady returns true if a pod is ready; false otherwise. credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go
func IsPodReadyConditionTrue ¶
IsPodReady retruns true if a pod is ready; false otherwise. credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go
func IsPodRunning ¶ added in v3.0.73
IsPodRunning returns true if a pod is running
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 WaitForPod ¶ added in v3.0.73
func WaitForPod(client kubernetes.Interface, namespace string, optionsModifier func(options *metav1.ListOptions), timeout time.Duration, condition PodPredicate) (*v1.Pod, error)
WaitForPod waits for a pod filtered by `optionsModifier` that match `condition`
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 it also has the side effect of logging the following * the logs of a pod that is detected as failed * the status of the pod
func WaitforPodNameCondition ¶ added in v3.0.17
func WaitforPodNameCondition(client kubernetes.Interface, namespace string, name string, timeout time.Duration, condition PodPredicate) error
WaitforPodNameCondition waits for the given pod name to match the given condition function
Types ¶
type PodPredicate ¶ added in v3.0.73
PodPredicate is a predicate over a pod