Package io.skodjob.testframe.utils
Class PodUtils
java.lang.Object
io.skodjob.testframe.utils.PodUtils
Represents utils class for pod
-
Method Summary
Modifier and TypeMethodDescriptionpodSnapshot(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector) Returns a map of resource name to resource version for all the pods in the givennamespacematching the givenselectorstatic voidverifyThatPodsAreStable(String namespaceName, io.fabric8.kubernetes.api.model.LabelSelector selector) Verify if the pod is stable after it is in ready state.static voidwaitForPodsReady(String namespaceName, boolean containersReady, Runnable onTimeout) Wait for all pods in namespace to be readystatic voidwaitForPodsReady(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 readystatic voidwaitForPodsReadyWithRestart(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
-
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 namespacecontainersReady- flag wait for all containersonTimeout- 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- namespaceselector- label selector of the podsexpectPodsCount- expected pods countcontainers- flag wait for all containersonTimeout- 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- namespaceselector- label selectorexpectedPodsCount- expected pods countcontainersReady- 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 givennamespacematching the givenselector- Parameters:
namespaceName- namesapceselector- 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- namespaceselector- label selector
-