pods

package
v0.0.0-...-7d54582 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDeletionTimeout = 120

DefaultDeletionTimeout contains the default pod deletion timeout in seconds

Variables

This section is empty.

Functions

func CheckPODSchedulingFailed

func CheckPODSchedulingFailed(c client.Client, pod *corev1.Pod) (bool, error)

func DumpResourceRequirements

func DumpResourceRequirements(pod *corev1.Pod) string

func ExecCommandOnPod

func ExecCommandOnPod(c *kubernetes.Clientset, pod *corev1.Pod, containerName string, command []string) ([]byte, error)

ExecCommandOnPod runs command in the pod and returns buffer output

func GetContainerIDByName

func GetContainerIDByName(pod *corev1.Pod, containerName string) (string, error)

GetContainerIDByName returns container ID under the pod by the container name

func GetLogs

func GetLogs(c *kubernetes.Clientset, pod *corev1.Pod) (string, error)

GetLogs returns logs of the specified pod

func GetPodsOnNode

func GetPodsOnNode(ctx context.Context, nodeName string) ([]corev1.Pod, error)

func GetTestPod

func GetTestPod() *corev1.Pod

GetTestPod returns pod with the busybox image

func WaitForCondition

func WaitForCondition(ctx context.Context, podKey client.ObjectKey, conditionType corev1.PodConditionType, conditionStatus corev1.ConditionStatus, timeout time.Duration) (*corev1.Pod, error)

WaitForCondition waits until the pod will have specified condition type with the expected status

func WaitForDeletion

func WaitForDeletion(ctx context.Context, pod *corev1.Pod, timeout time.Duration) error

WaitForDeletion waits until the pod will be removed from the cluster

func WaitForPhase

func WaitForPhase(ctx context.Context, podKey client.ObjectKey, phase corev1.PodPhase, timeout time.Duration) (*corev1.Pod, error)

WaitForPhase waits until the pod will have specified phase

func WaitForPodOutput

func WaitForPodOutput(ctx context.Context, c *kubernetes.Clientset, pod *corev1.Pod, command []string) ([]byte, error)

func WaitForPredicate

func WaitForPredicate(ctx context.Context, podKey client.ObjectKey, timeout time.Duration, pred func(pod *corev1.Pod) (bool, error)) (*corev1.Pod, error)

WaitForPredicate waits until the given predicate against the pod returns true or error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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