Class StatefulSetUtils
- java.lang.Object
-
- io.strimzi.systemtest.utils.kubeUtils.controllers.StatefulSetUtils
-
public class StatefulSetUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
ssHasRolled(String name, Map<String,String> snapshot)
Method to check that all pods for expected StatefulSet were rolledstatic Map<String,String>
ssSnapshot(String name)
Returns a map of pod name to resource version for the pods currently in the given statefulset.static void
waitForAllStatefulSetPodsReady(String statefulSetName, int expectPods)
Wait until the STS is ready and all of its Pods are also ready with default timeout.static void
waitForAllStatefulSetPodsReady(String statefulSetName, int expectPods, long timeout)
Wait until the STS is ready and all of its Pods are also ready with custom timeout.static void
waitForNoRollingUpdate(String statefulSetName, Map<String,String> pods)
static void
waitForStatefulSetDeletion(String name)
Wait until the given StatefulSet has been deleted.static void
waitForStatefulSetLabelsChange(String statefulSetName, Map<String,String> labels)
static void
waitForStatefulSetLabelsDeletion(String statefulSetName, String... labelKeys)
static void
waitForStatefulSetRecovery(String name, String statefulSetUid)
Wait until the given StatefulSet has been recovered.static Map<String,String>
waitTillSsHasRolled(String name, int expectedPods, Map<String,String> snapshot)
Method to wait when StatefulSet will be recreated after rolling update with wait for all pods readystatic Map<String,String>
waitTillSsHasRolled(String name, Map<String,String> snapshot)
Method to wait when StatefulSet will be recreated after rolling update
-
-
-
Method Detail
-
ssSnapshot
public static Map<String,String> ssSnapshot(String name)
Returns a map of pod name to resource version for the pods currently in the given statefulset.- Parameters:
name
- The StatefulSet name- Returns:
- A map of pod name to resource version for pods in the given StatefulSet.
-
ssHasRolled
public static boolean ssHasRolled(String name, Map<String,String> snapshot)
Method to check that all pods for expected StatefulSet were rolled- Parameters:
name
- StatefulSet namesnapshot
- Snapshot of pods for StatefulSet before the rolling update- Returns:
- true when the pods for StatefulSet are recreated
-
waitTillSsHasRolled
public static Map<String,String> waitTillSsHasRolled(String name, Map<String,String> snapshot)
Method to wait when StatefulSet will be recreated after rolling update- Parameters:
name
- StatefulSet namesnapshot
- Snapshot of pods for StatefulSet before the rolling update- Returns:
- The snapshot of the StatefulSet after rolling update with Uid for every pod
-
waitTillSsHasRolled
public static Map<String,String> waitTillSsHasRolled(String name, int expectedPods, Map<String,String> snapshot)
Method to wait when StatefulSet will be recreated after rolling update with wait for all pods ready- Parameters:
name
- StatefulSet nameexpectedPods
- Expected number of podssnapshot
- Snapshot of pods for StatefulSet before the rolling update- Returns:
- The snapshot of the StatefulSet after rolling update with Uid for every pod
-
waitForAllStatefulSetPodsReady
public static void waitForAllStatefulSetPodsReady(String statefulSetName, int expectPods, long timeout)
Wait until the STS is ready and all of its Pods are also ready with custom timeout.- Parameters:
statefulSetName
- The name of the StatefulSetexpectPods
- The number of pods expected.
-
waitForAllStatefulSetPodsReady
public static void waitForAllStatefulSetPodsReady(String statefulSetName, int expectPods)
Wait until the STS is ready and all of its Pods are also ready with default timeout.- Parameters:
statefulSetName
- The name of the StatefulSetexpectPods
- The number of pods expected.
-
waitForStatefulSetDeletion
public static void waitForStatefulSetDeletion(String name)
Wait until the given StatefulSet has been deleted.- Parameters:
name
- The name of the StatefulSet.
-
waitForStatefulSetRecovery
public static void waitForStatefulSetRecovery(String name, String statefulSetUid)
Wait until the given StatefulSet has been recovered.- Parameters:
name
- The name of the StatefulSet.
-
waitForStatefulSetLabelsChange
public static void waitForStatefulSetLabelsChange(String statefulSetName, Map<String,String> labels)
-
waitForStatefulSetLabelsDeletion
public static void waitForStatefulSetLabelsDeletion(String statefulSetName, String... labelKeys)
-
-