package
1.33.0-alpha.2
Repository: https://github.com/kubernetes/kubernetes.git
Documentation: pkg.go.dev

# Packages

# Functions

BeInPhase matches if pod.status.phase is the expected phase.
BeRunningNoRetries verifies that a pod starts running.
CheckPodsRunningReady returns whether all pods whose names are listed in podNames in namespace ns are running and ready, using c and waiting at most timeout.
CheckPodsRunningReadyOrSucceeded returns whether all pods whose names are listed in podNames in namespace ns are running and ready, or succeeded; use c and waiting at most timeout.
CreateClientPod defines and creates a pod with a mounted PV.
CreateExecPodOrFail creates a agnhost pause pod used as a vessel for kubectl exec commands.
CreatePod with given claims based on node selector.
CreateSecPod creates security pod with given claims.
CreateSecPodWithNodeSelection creates security pod with given claims.
CreateUnschedulablePod with given claims based on node selector.
DeletePodOrFail deletes the pod of the specified namespace and name.
DeletePodsWithGracePeriod deletes the passed-in pods.
DeletePodWithGracePeriod deletes the passed-in pod.
DeletePodWithGracePeriodByName deletes a pod by name and namespace.
DeletePodWithWait deletes the passed-in pod and waits for the pod to be terminated.
DeletePodWithWaitByName deletes the named and namespaced pod and waits for the pod to be terminated.
DumpAllPodInfoForNamespace logs all pod information for a given namespace.
ExecCommandInContainer executes a command in the specified container.
ExecCommandInContainerWithFullOutput executes a command in the specified container and return stdout, stderr and error.
ExecShellInContainer executes the specified command on the pod's container.
ExecShellInPod executes the specified command on the pod.
ExecShellInPodWithFullOutput executes the specified command on the Pod and returns stdout, stderr and error.
ExecWithOptions executes a command in the specified container, returning stdout, stderr and error.
FilterActivePods returns pods that have not terminated.
FilterNonRestartablePods filters out pods that will never get recreated if deleted after termination.
FindContainerStatusInPod finds a container status by its name in the provided pod.
FindPodConditionByType loops through all pod conditions in pod status and returns the specified condition.
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.
GenerateContainerSecurityContext generates the corresponding container security context with the given inputs If the Node OS is windows, currently we will ignore the inputs and return nil.
GeneratePodSecurityContext generates the corresponding pod security context with the given inputs If the Node OS is windows, currently we will ignore the inputs and return nil.
GenerateScriptCmd generates the corresponding command lines to execute a command.
Get creates a function which retrieves the pod anew each time the function is called.
GetDefaultNonRootUser returns default non root user If the Node OS is windows, we return nill due to issue with invalid permissions set on projected volumes https://github.com/kubernetes/kubernetes/issues/102849.
GetDefaultTestImage returns the default test image based on OS.
GetDefaultTestImageID returns the default test image id based on OS.
GetLinuxLabel returns the default SELinuxLabel based on OS.
GetPodLogs returns the logs of the specified container (namespace/pod/container).
GetPodLogsSince returns the logs of the specified container (namespace/pod/container) since a timestamp.
GetPods return the label matched pods in the given ns.
GetPodSecretUpdateTimeout returns the timeout duration for updating pod secret.
GetPodsInNamespace returns the pods in the given namespace.
GetPreviousPodLogs returns the logs of the previous instance of the specified container (namespace/pod/container).
GetRestrictedContainerSecurityContext returns a minimal restricted container security context.
GetRestrictedPodSecurityContext returns a restricted pod security context.
GetTestImage returns the image name with the given input If the Node OS is windows, currently we return Agnhost image for Windows node due to the issue of #https://github.com/kubernetes-sigs/windows-testing/pull/35.
GetTestImageID returns the image id with the given input If the Node OS is windows, currently we return Agnhost image for Windows node due to the issue of #https://github.com/kubernetes-sigs/windows-testing/pull/35.
IsPodActive return true if the pod meets certain conditions.
IsPodOnCgroupv2Node checks whether the pod is running on cgroupv2 node.
LogPodStates logs basic info of provided pods for debugging.
MakePod returns a pod definition based on the namespace.
MakePodSpec returns a PodSpec definition.
MakeSecPod returns a pod definition based on the namespace.
MixinRestrictedPodSecurity makes the given pod compliant with the restricted pod security level.
MustMixinRestrictedPodSecurity makes the given pod compliant with the restricted pod security level.
NewAgnhostContainer returns the container Spec of an agnhost container.
NewAgnhostPod returns a pod that uses the agnhost image.
NewDialer creates a dialer that supports connecting to container ports.
NewExecPodSpec returns the pod spec of hostexec pod.
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.
NewTransport creates a transport which uses the port forward dialer.
ParseAddr expects a <namespace>.<pod>:<port number> as produced by Addr.String.
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.
PodsCreatedByLabel returns a created pod list matched by the given label.
ResizeContainerPatch generates a patch string to resize the pod container.
RunningReady checks whether pod p's phase is running and it has a ready condition of status true.
SetAffinity sets affinity to nodeName to nodeSelection.
SetAntiAffinity sets anti-affinity to nodeName to nodeSelection.
SetNodeAffinity modifies the given pod object with NodeAffinity to the given node name.
SetNodeAffinityTopologyRequirement sets node affinity to a specified topology.
SetNodeSelection modifies the given pod object with the specified NodeSelection.
VerifyCgroupValue verifies that the given cgroup path has the expected value in the specified container of the pod.
VerifyExecInPodFail verifies shell cmd in target pod fail with certain exit code.
VerifyExecInPodSucceed verifies shell cmd in target pod succeed.
VerifyPodHasConditionWithType verifies the pod has the expected condition by type.
VerifyPods checks if the specified pod is responding.
VerifyPodsRunning checks if the specified pod is running.
WaitForAlmostAllReady waits up to timeout for the following conditions: 1.
WaitForContainerRunning waits for the given Pod container to have a state of running.
WaitForContainerTerminated waits for the given Pod container to have a state of terminated.
WaitForNRestartablePods tries to list restarting pods using ps until it finds expect of them, returning their names if it can do so before timeout.
WaitForNumberOfPods waits up to timeout to ensure there are exact `num` pods in namespace `ns`.
WaitForPodCondition waits a pods to be matched to the given condition.
WaitForPodContainerStarted waits for the given Pod container to start, after a successful run of the startupProbe.
WaitForPodContainerToFail waits for the given Pod container to fail with the given reason, specifically due to invalid container configuration.
WaitForPodFailedReason wait for pod failed reason in status, for example "SysctlForbidden".
WaitForPodInitContainerStarted waits for the given Pod init container to start.
WaitForPodNameRunningInNamespace waits default amount of time (PodStartTimeout) for the specified pod to become running.
WaitForPodNameUnschedulableInNamespace returns an error if it takes too long for the pod to become Pending and have condition Status equal to Unschedulable, if the pod Get api returns an error (IsNotFound or other), or if the pod failed with an unexpected reason.
WaitForPodNoLongerRunningInNamespace waits default amount of time (defaultPodDeletionTimeout) for the specified pod to stop running.
WaitForPodNotFoundInNamespace returns an error if it takes too long for the pod to fully terminate.
WaitForPodNotPending returns an error if it took too long for the pod to go out of pending state.
WaitForPodRunningInNamespace waits default amount of time (podStartTimeout) for the specified pod to become running.
WaitForPodRunningInNamespaceSlow waits an extended amount of time (slowPodStartTimeout) for the specified pod to become running.
WaitForPods waits for pods in the given namespace to match the given condition.
WaitForPodScheduled waits for the pod to be schedule, ie.
WaitForPodsResponding waits for the pods to response.
WaitForPodsRunning waits for a given `timeout` to evaluate if a certain amount of pods in given `ns` are running.
WaitForPodsRunningReady waits up to timeout for the following conditions: 1.
WaitForPodsSchedulingGated waits for a given `timeout` to evaluate if a certain amount of pods in given `ns` stay in scheduling gated state.
WaitForPodSuccessInNamespace returns nil if the pod reached state success, or an error if it reached failure or until podStartupTimeout.
WaitForPodSuccessInNamespaceTimeout returns nil if the pod reached state success, or an error if it reached failure or ran too long.
WaitForPodsWithLabel waits up to podListTimeout for getting pods with certain label.
WaitForPodsWithLabelRunningReady waits for exact amount of matching pods to become running and ready.
WaitForPodsWithLabelScheduled waits for all matching pods to become scheduled and at least one matching pod exists.
WaitForPodsWithSchedulingGates waits for a given `timeout` to evaluate if a certain amount of pods in given `ns` match the given `schedulingGates`stay in scheduling gated state.
WaitForPodTerminatedInNamespace returns an error if it takes too long for the pod to terminate, if the pod Get api returns an error (IsNotFound or other), or if the pod failed (and thus did not terminate) with an unexpected reason.
WaitForPodTerminatingInNamespaceTimeout returns if the pod is terminating, or an error if it is not after the timeout.
WaitTimeoutForPodNoLongerRunningInNamespace waits the given timeout duration for the specified pod to stop.
WaitTimeoutForPodReadyInNamespace waits the given timeout duration for the specified pod to be ready and running.
WaitTimeoutForPodRunningInNamespace waits the given timeout duration for the specified pod to become running.
WithWindowsHostProcess sets the Pod's Windows HostProcess option to true.

# Constants

which test created this pod?.
DefaultNonRootUser is the default user ID used for running restricted (non-root) containers.
DefaultNonRootUserName is the default username in Windows used for running restricted (non-root) containers.
DefaultPodDeletionTimeout is the default timeout for deleting pod.
LabelLogOnPodFailure can be used to mark which Pods will have their logs logged in the case of a test failure.
PodDeleteTimeout is how long to wait for a pod to be deleted.

# Variables

GlobalOwnerTracking controls if newly created PodClients should automatically annotate the pod with the owner test.
ImagePrePullList is the images used in the current test suite.

# Structs

Addr contains all relevant parameters for a certain port in a pod.
Config is a struct containing all arguments for creating a pod.
Dialer holds the relevant parameters that are independent of a particular connection.
ExecOptions passed to ExecWithOptions.
NodeSelection specifies where to run a pod, using a combination of fixed node name, node selector and/or affinity.
PodClient is a struct for pod client.
Range determines how many items must exist and how many must match a certain condition.