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 void
deletePodWithWait(String name)
static String
getContainerImageNameFromPod(String podName, String containerName)
static String
getFirstContainerImageNameFromPod(String podName)
static String
getFirstPodNameContaining(String searchTerm)
static String
getInitContainerImageName(String podName)
static String
getPodNameByPrefix(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 givennamespace
matching the givenselector
.static void
verifyThatPendingPodsAreStable(String podPrefix)
static void
verifyThatRunningPodsAreStable(String podPrefix)
Ensures every pod in a StatefulSet is stable in theRunning
phase.static void
waitForPendingPod(String podPrefix)
Ensures that at least one pod from listed (by prefix) is inPending
phasestatic void
waitForPod(String name)
static void
waitForPodContainerReady(String podName, String containerName)
static void
waitForPodsReady(io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPods, boolean containers)
static void
waitForPodsReady(io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPods, boolean containers, Runnable onTimeout)
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)
)}static void
waitForPodUpdate(String podName, Date startTime)
static void
waitUntilMessageIsInLogs(String podName, String containerName, String message)
static void
waitUntilMessageIsInPodLogs(String podName, String message)
static void
waitUntilPodContainersCount(String podNamePrefix, int numberOfContainers)
static void
waitUntilPodIsInCrashLoopBackOff(String podName)
static void
waitUntilPodIsInPendingStatus(String podName)
static void
waitUntilPodIsPresent(String podNamePrefix)
static void
waitUntilPodLabelsDeletion(String podName, String... labelKeys)
static void
waitUntilPodsCountIsPresent(String podNamePrefix, int numberOfPods)
static void
waitUntilPodStabilityReplicasCount(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 givennamespace
matching 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 inPending
phase- 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 theRunning
phase. A pod must be in the Running phase forConstants.GLOBAL_RECONCILIATION_COUNT
seconds 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)
-
-