Documentation ¶
Index ¶
- Constants
- Variables
- func ExecAndLogCommand(name string, arg ...string) ([]byte, error)
- func ExecCommandOnPod(pod *corev1.Pod, command []string) ([]byte, error)
- func GetPodLogs(c *kubernetes.Clientset, pod *corev1.Pod) (string, error)
- func GetTestPod() *corev1.Pod
- func GetWithRetry(ctx context.Context, key client.ObjectKey, obj client.Object) error
- func New() (client.Client, error)
- func NewK8s() (*kubernetes.Clientset, error)
- func Setup() error
- func Teardown() error
- func WaitForNamespaceDeletion(name string, timeout time.Duration) error
- func WaitForPodCondition(pod *corev1.Pod, conditionType corev1.PodConditionType, ...) error
- func WaitForPodDeletion(pod *corev1.Pod, timeout time.Duration) error
- func WaitForPodPhase(pod *corev1.Pod, phase corev1.PodPhase, timeout time.Duration) error
Constants ¶
View Source
const (
DefaultDevicePath = "/dev/null"
)
Variables ¶
View Source
var ( // Client defines the API client to run CRUD operations, that will be used for testing Client client.Client // K8sClient defines k8s client to run subresource operations, for example you should use it to get pod logs K8sClient *kubernetes.Clientset // TestingNamespace is the namespace the tests will use for running test pods TestingNamespace *corev1.Namespace = &corev1.Namespace{ ObjectMeta: metav1.ObjectMeta{ GenerateName: "sample-device-plugin-test-", }, } )
Functions ¶
func ExecCommandOnPod ¶
ExecCommandOnPod returns the output of the command execution on the pod
func GetPodLogs ¶
GetPodLogs returns logs of the specified pod
func GetWithRetry ¶
func WaitForNamespaceDeletion ¶
WaitForNamespaceDeletion waits until the namespace will be removed from the cluster
func WaitForPodCondition ¶
func WaitForPodCondition(pod *corev1.Pod, conditionType corev1.PodConditionType, conditionStatus corev1.ConditionStatus, timeout time.Duration) error
WaitForPodCondition waits until the pod will have specified condition type with the expected status
func WaitForPodDeletion ¶
WaitForPodDeletion waits until the pod will be removed from the cluster
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.