Class DeploymentUtils


  • public class DeploymentUtils
    extends Object
    • 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 name
        snapshot - 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 name
        expectedPods - Expected number of pods
        snapshot - 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.