Class PodUtils

java.lang.Object
io.skodjob.testframe.utils.PodUtils

public final class PodUtils extends Object
Represents utils class for pod
  • Method Summary

    Modifier and Type
    Method
    Description
    static Map<String,String>
    podSnapshot(String namespaceName, 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
    verifyThatPodsAreStable(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector)
    Verify if the pod is stable after it is in ready state.
    static void
    waitForPodsReady(String namespaceName, boolean containersReady, Runnable onTimeout)
    Wait for all pods in namespace to be ready
    static void
    waitForPodsReady(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPodsCount, boolean containers, Runnable onTimeout)
    Wait for pods selected by label selector in namespace to be ready
    static void
    waitForPodsReadyWithRestart(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector, int expectedPodsCount, boolean containersReady)
    Wait for pod ready, if not ready for timeout try to restart and check again

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • waitForPodsReady

      public static void waitForPodsReady(String namespaceName, boolean containersReady, Runnable onTimeout)
      Wait for all pods in namespace to be ready
      Parameters:
      namespaceName - name of the namespace
      containersReady - flag wait for all containers
      onTimeout - callback on timeout
    • waitForPodsReady

      public static void waitForPodsReady(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector, int expectPodsCount, boolean containers, Runnable onTimeout)
      Wait for pods selected by label selector in namespace to be ready
      Parameters:
      namespaceName - namespace
      selector - label selector of the pods
      expectPodsCount - expected pods count
      containers - flag wait for all containers
      onTimeout - callback on timeout
    • waitForPodsReadyWithRestart

      public static void waitForPodsReadyWithRestart(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector, int expectedPodsCount, boolean containersReady)
      Wait for pod ready, if not ready for timeout try to restart and check again
      Parameters:
      namespaceName - namespace
      selector - label selector
      expectedPodsCount - expected pods count
      containersReady - flag wait for containers
    • podSnapshot

      public static Map<String,String> podSnapshot(String namespaceName, 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
      Parameters:
      namespaceName - namesapce
      selector - label selector
      Returns:
      key value map podName -> uid
    • verifyThatPodsAreStable

      public static void verifyThatPodsAreStable(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector)
      Verify if the pod is stable after it is in ready state.
      Parameters:
      namespaceName - namespace
      selector - label selector