Class DeploymentUtils
- java.lang.Object
-
- io.strimzi.systemtest.utils.kubeUtils.controllers.DeploymentUtils
-
public class DeploymentUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
depHasRolled(String name, Map<String,String> snapshot)
Method to check that all pods for expected Deployment were rolledstatic Map<String,String>
depSnapshot(String name)
Returns a map of pod name to resource version for the pods currently in the given deployment.static void
logCurrentDeploymentStatus(io.fabric8.kubernetes.api.model.apps.Deployment deployment)
Log actual status of deployment with podsstatic void
waitForDeploymentAndPodsReady(String deploymentName, int expectPods)
Wait until the given Deployment is ready.static void
waitForDeploymentDeletion(String name)
Wait until the given Deployment has been deleted.static void
waitForDeploymentReady(String deploymentName)
static void
waitForDeploymentRecovery(String name, String deploymentUid)
Wait until the given Deployment has been recovered.static void
waitForNoRollingUpdate(String deploymentName, Map<String,String> pods)
static Map<String,String>
waitTillDepHasRolled(String name, int expectedPods, Map<String,String> snapshot)
Method to wait when Deployment will be recreated after rolling update
-
-
-
Method Detail
-
logCurrentDeploymentStatus
public static void logCurrentDeploymentStatus(io.fabric8.kubernetes.api.model.apps.Deployment deployment)
Log actual status of deployment with pods- Parameters:
deployment
- - every Deployment, that HasMetadata and has status (fabric8 status)
-
waitForNoRollingUpdate
public static void waitForNoRollingUpdate(String deploymentName, Map<String,String> pods)
-
depSnapshot
public static Map<String,String> depSnapshot(String name)
Returns a map of pod name to resource version for the pods currently in the given deployment.- Parameters:
name
- The Deployment name.- Returns:
- A map of pod name to resource version for pods in the given Deployment.
-
depHasRolled
public static boolean depHasRolled(String name, Map<String,String> snapshot)
Method to check that all pods for expected Deployment were rolled- Parameters:
name
- Deployment namesnapshot
- Snapshot of pods for Deployment before the rolling update- Returns:
- true when the pods for Deployment are recreated
-
waitTillDepHasRolled
public static Map<String,String> waitTillDepHasRolled(String name, int expectedPods, Map<String,String> snapshot)
Method to wait when Deployment will be recreated after rolling update- Parameters:
name
- Deployment nameexpectedPods
- Expected number of podssnapshot
- Snapshot of pods for Deployment before the rolling update- Returns:
- The snapshot of the Deployment after rolling update with Uid for every pod
-
waitForDeploymentRecovery
public static void waitForDeploymentRecovery(String name, String deploymentUid)
Wait until the given Deployment has been recovered.- Parameters:
name
- The name of the Deployment.
-
waitForDeploymentReady
public static void waitForDeploymentReady(String deploymentName)
-
waitForDeploymentAndPodsReady
public static void waitForDeploymentAndPodsReady(String deploymentName, int expectPods)
Wait until the given Deployment is ready.- Parameters:
deploymentName
- The name of the Deployment.expectPods
- The expected number of pods.
-
waitForDeploymentDeletion
public static void waitForDeploymentDeletion(String name)
Wait until the given Deployment has been deleted.- Parameters:
name
- The name of the Deployment.
-
-