Package io.strimzi.systemtest.utils.kubeUtils.objects

## 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 given `namespace` matching the given `selector`.
    `static void` | `verifyThatPendingPodsAreStable​(String podPrefix)` |
    `static void` | `verifyThatRunningPodsAreStable​(String podPrefix)` | Ensures every pod in a StatefulSet is stable in the `Running` phase.
    `static void` | `waitForPendingPod​(String podPrefix)` | Ensures that at least one pod from listed (by prefix) is in `Pending` phase
    `static 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)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 given `namespace` matching the given `selector`.

    - #### getFirstContainerImageNameFromPod

          public static String getFirstContainerImageNameFromPod​(String podName)

    - #### getContainerImageNameFromPod

          public static String getContainerImageNameFromPod​(String podName,
                                                            String containerName)

    - #### getInitContainerImageName

          public static String getInitContainerImageName​(String podName)

    - #### 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)

    - #### waitForPodUpdate

          public static void waitForPodUpdate​(String podName,
                                              Date startTime)

    - #### 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

    - #### getPodNameByPrefix

          public static String getPodNameByPrefix​(String prefix)

    - #### getFirstPodNameContaining

          public static String getFirstPodNameContaining​(String searchTerm)

    - #### 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 in `Pending` 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 the `Running` phase. A pod must be in the Running phase for `Constants.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)

    - #### waitForPodContainerReady

          public static void waitForPodContainerReady​(String podName,
                                                      String containerName)