Class PodUtils
- java.lang.Object
-
- io.strimzi.systemtest.utils.kubeUtils.objects.PodUtils
-
public class PodUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeletePodWithWait(String name)static StringgetContainerImageNameFromPod(String podName, String containerName)static StringgetFirstContainerImageNameFromPod(String podName)static StringgetFirstPodNameContaining(String searchTerm)static StringgetInitContainerImageName(String podName)static StringgetPodNameByPrefix(String prefix)static Map<String,String>podSnapshot(io.fabric8.kubernetes.api.model.LabelSelector selector)Returns a map of resource name to resource version for all the pods in the givennamespacematching the givenselector.static voidverifyThatPendingPodsAreStable(String podPrefix)static voidverifyThatRunningPodsAreStable(String podPrefix)Ensures every pod in a StatefulSet is stable in theRunningphase.static voidwaitForPendingPod(String podPrefix)Ensures that at least one pod from listed (by prefix) is inPendingphasestatic voidwaitForPod(String name)static voidwaitForPodContainerReady(String podName, String containerName)static voidwaitForPodsReady(io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPods, boolean containers)static voidwaitForPodsReady(io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPods, boolean containers, Runnable onTimeout)static voidwaitForPodsWithPrefixDeletion(String podsNamePrefix)The method to wait when all pods of specific prefix will be deleted To wait for the cluster to be updated, the following methods must be used:StatefulSetUtils.ssHasRolled(String, Map),StatefulSetUtils.waitTillSsHasRolled(String, int, Map))}static voidwaitForPodUpdate(String podName, Date startTime)static voidwaitUntilMessageIsInLogs(String podName, String containerName, String message)static voidwaitUntilMessageIsInPodLogs(String podName, String message)static voidwaitUntilPodContainersCount(String podNamePrefix, int numberOfContainers)static voidwaitUntilPodIsInCrashLoopBackOff(String podName)static voidwaitUntilPodIsInPendingStatus(String podName)static voidwaitUntilPodIsPresent(String podNamePrefix)static voidwaitUntilPodLabelsDeletion(String podName, String... labelKeys)static voidwaitUntilPodsCountIsPresent(String podNamePrefix, int numberOfPods)static voidwaitUntilPodStabilityReplicasCount(String podNamePrefix, int expectedPods)
-
-
-
Method Detail
-
podSnapshot
public static Map<String,String> podSnapshot(io.fabric8.kubernetes.api.model.LabelSelector selector)
Returns a map of resource name to resource version for all the pods in the givennamespacematching the givenselector.
-
getFirstContainerImageNameFromPod
public static String getFirstContainerImageNameFromPod(String podName)
-
getContainerImageNameFromPod
public static String getContainerImageNameFromPod(String podName, String containerName)
-
waitForPodsReady
public static void waitForPodsReady(io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPods, boolean containers)
-
waitForPodsReady
public static void waitForPodsReady(io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPods, boolean containers, Runnable onTimeout)
-
waitForPodsWithPrefixDeletion
public static void waitForPodsWithPrefixDeletion(String podsNamePrefix)
The method to wait when all pods of specific prefix will be deleted To wait for the cluster to be updated, the following methods must be used:StatefulSetUtils.ssHasRolled(String, Map),StatefulSetUtils.waitTillSsHasRolled(String, int, Map))}- Parameters:
podsNamePrefix- Cluster name where pods should be deleted
-
waitForPod
public static void waitForPod(String name)
-
deletePodWithWait
public static void deletePodWithWait(String name)
-
waitUntilPodsCountIsPresent
public static void waitUntilPodsCountIsPresent(String podNamePrefix, int numberOfPods)
-
waitUntilMessageIsInPodLogs
public static void waitUntilMessageIsInPodLogs(String podName, String message)
-
waitUntilMessageIsInLogs
public static void waitUntilMessageIsInLogs(String podName, String containerName, String message)
-
waitUntilPodContainersCount
public static void waitUntilPodContainersCount(String podNamePrefix, int numberOfContainers)
-
waitUntilPodStabilityReplicasCount
public static void waitUntilPodStabilityReplicasCount(String podNamePrefix, int expectedPods)
-
waitUntilPodIsInCrashLoopBackOff
public static void waitUntilPodIsInCrashLoopBackOff(String podName)
-
waitUntilPodIsPresent
public static void waitUntilPodIsPresent(String podNamePrefix)
-
waitUntilPodIsInPendingStatus
public static void waitUntilPodIsInPendingStatus(String podName)
-
waitUntilPodLabelsDeletion
public static void waitUntilPodLabelsDeletion(String podName, String... labelKeys)
-
waitForPendingPod
public static void waitForPendingPod(String podPrefix)
Ensures that at least one pod from listed (by prefix) is inPendingphase- Parameters:
podPrefix- - all pods that matched the prefix will be verified
-
verifyThatRunningPodsAreStable
public static void verifyThatRunningPodsAreStable(String podPrefix)
Ensures every pod in a StatefulSet is stable in theRunningphase. A pod must be in the Running phase forConstants.GLOBAL_RECONCILIATION_COUNTseconds for it to be considered as stable. Otherwise this procedure will be repeat.- Parameters:
podPrefix- all pods that matched the prefix will be verified
-
verifyThatPendingPodsAreStable
public static void verifyThatPendingPodsAreStable(String podPrefix)
-
-