const DefaultPodDeletionTimeout … const killingContainer … const failedToCreateContainer … const startedContainer … const forbiddenReason … const AnnotationTestOwner … var GlobalOwnerTracking … var ImagePrePullList … // NewPodClient is a convenience method for getting a pod client interface in the framework's namespace, // possibly applying test-suite specific transformations to the pod spec, e.g. for // node e2e pod scheduling. func NewPodClient(f *framework.Framework) *PodClient { … } // PodClientNS is a convenience method for getting a pod client interface in an alternative namespace, // possibly applying test-suite specific transformations to the pod spec, e.g. for // node e2e pod scheduling. func PodClientNS(f *framework.Framework, namespace string) *PodClient { … } type PodClient … // WithOwnerTracking controls automatic add of annotations recording the code location // which created a pod. This is helpful when troubleshooting e2e tests (like e2e_node) // which leak pods because insufficient cleanup. // Note we want a shallow clone to avoid mutating the receiver. // The default is the value of GlobalOwnerTracking *when the client was created*. func (c PodClient) WithOwnerTracking(value bool) *PodClient { … } // Create creates a new pod according to the framework specifications (don't wait for it to start). func (c *PodClient) Create(ctx context.Context, pod *v1.Pod) *v1.Pod { … } // CreateSync creates a new pod according to the framework specifications, and wait for it to start and be running and ready. func (c *PodClient) CreateSync(ctx context.Context, pod *v1.Pod) *v1.Pod { … } // CreateBatch create a batch of pods. All pods are created before waiting. func (c *PodClient) CreateBatch(ctx context.Context, pods []*v1.Pod) []*v1.Pod { … } // Update updates the pod object. It retries if there is a conflict, throw out error if // there is any other apierrors. name is the pod name, updateFn is the function updating the // pod object. func (c *PodClient) Update(ctx context.Context, name string, updateFn func(pod *v1.Pod)) { … } // AddEphemeralContainerSync adds an EphemeralContainer to a pod and waits for it to be running. func (c *PodClient) AddEphemeralContainerSync(ctx context.Context, pod *v1.Pod, ec *v1.EphemeralContainer, timeout time.Duration) error { … } // FormatPod returns a string representing a pod in a consistent human readable format, // with pod name, namespace and pod UID as part of the string. // This code is taken from k/k/pkg/kubelet/util/format/pod.go to remove // e2e framework -> k/k/pkg/kubelet dependency. func FormatPod(pod *v1.Pod) string { … } // DeleteSync deletes the pod and wait for the pod to disappear for `timeout`. If the pod doesn't // disappear before the timeout, it will fail the test. func (c *PodClient) DeleteSync(ctx context.Context, name string, options metav1.DeleteOptions, timeout time.Duration) { … } // addTestOrigin adds annotations to help identifying tests which incorrectly leak pods because insufficient cleanup func (c *PodClient) setOwnerAnnotation(pod *v1.Pod) { … } // mungeSpec apply test-suite specific transformations to the pod spec. func (c *PodClient) mungeSpec(pod *v1.Pod) { … } // WaitForSuccess waits for pod to succeed. // TODO(random-liu): Move pod wait function into this file func (c *PodClient) WaitForSuccess(ctx context.Context, name string, timeout time.Duration) { … } // WaitForFinish waits for pod to finish running, regardless of success or failure. func (c *PodClient) WaitForFinish(ctx context.Context, name string, timeout time.Duration) { … } // WaitForErrorEventOrSuccess waits for pod to succeed or an error event for that pod. func (c *PodClient) WaitForErrorEventOrSuccess(ctx context.Context, pod *v1.Pod) (*v1.Event, error) { … } // WaitForErrorEventOrSuccessWithTimeout waits for pod to succeed or an error event for that pod for a specified time func (c *PodClient) WaitForErrorEventOrSuccessWithTimeout(ctx context.Context, pod *v1.Pod, timeout time.Duration) (*v1.Event, error) { … } // MatchContainerOutput gets output of a container and match expected regexp in the output. func (c *PodClient) MatchContainerOutput(ctx context.Context, name string, containerName string, expectedRegexp string) error { … } // PodIsReady returns true if the specified pod is ready. Otherwise false. func (c *PodClient) PodIsReady(ctx context.Context, name string) bool { … } // RemoveString returns a newly created []string that contains all items from slice // that are not equal to s. // This code is taken from k/k/pkg/util/slice/slice.go to remove // e2e/framework/pod -> k/k/pkg/util/slice dependency. func removeString(slice []string, s string) []string { … } // RemoveFinalizer removes the pod's finalizer func (c *PodClient) RemoveFinalizer(ctx context.Context, podName string, finalizerName string) { … }