Class OpenShiftWaiters


  • public class OpenShiftWaiters
    extends Object
    • Method Detail

      • get

        public static OpenShiftWaiters get​(OpenShift openShift,
                                           FailFastCheck failFast)
        Parameters:
        openShift - openshift client
        failFast - BooleanSupplier that returns true if waiter should fail due to error state of i.e. OpenShift
        Returns:
        returns Openshift waiters
      • hasBuildCompleted

        public Waiter hasBuildCompleted​(String buildConfigName)
        Creates waiter for latest build completion with a build timeout which is preconfigured to be up to 10 minutes (but can also be customized by setting xtf.waiting.build.timeout), 5 seconds interval check and both logging points.
        Parameters:
        buildConfigName - build name to wait upon
        Returns:
        Waiter instance
      • hasBuildCompleted

        public Waiter hasBuildCompleted​(io.fabric8.openshift.api.model.Build build)
        Creates waiter for build completion with a build timeout which is preconfigured to be up to 10 minutes (but can also be customized by setting xtf.waiting.build.timeout), 5 seconds interval check and both logging points.
        Parameters:
        build - to be waited upon.
        Returns:
        Waiter instance
      • isLatestBuildPresent

        public Waiter isLatestBuildPresent​(String buildConfigName)
        Creates waiter for latest build presence with default timeout, 5 seconds interval check and both logging points.
        Parameters:
        buildConfigName - name of buildConfig for which build to be waited upon
        Returns:
        Waiter instance
      • isProjectReady

        public Waiter isProjectReady()
        Create waiter for project to created with 20 seconds timeout.
        Returns:
        Waiter instance
      • isProjectClean

        public Waiter isProjectClean()
        Creates waiter for clean project with 20 seconds timeout.
        Returns:
        Waiter instance
      • isDcReady

        public Waiter isDcReady​(String dcName)
        Creates a waiter object waiting till all pods created by deployment config with name dcName are ready. Tolerates any container restarts. Uses default timeout.
        Parameters:
        dcName - name of deploymentConfig
        Returns:
        Waiter instance
      • isDcReady

        public Waiter isDcReady​(String dcName,
                                int restartTolerance)
        Creates a waiter object that waits till all pods created by deployment config with name dcName are ready. Tolerates restartTolerace container restarts. Uses default timeout.
        Parameters:
        dcName - name of deploymentConfig
        restartTolerance - number of container rest
        Returns:
        Waiter instance
      • isDeploymentReady

        public Waiter isDeploymentReady​(String dcName,
                                        int version)
        Creates a waiter object that waits till all pods created by deployment config with name dcName are ready. Tolerates any container restarts. Uses default timeout.
        Parameters:
        dcName - name of deploymentConfig
        version - version of deploymentConfig to be waited upon
        Returns:
        Waiter instance
      • isDeploymentReady

        public Waiter isDeploymentReady​(String dcName,
                                        int version,
                                        int restartTolerance)
        Creates a waiter object that waits till all pods created by deployment config with name dcName are ready. Tolerates any container restarts. Uses default timeout.
        Parameters:
        dcName - name of deploymentConfig
        version - deployment version
        restartTolerance - number of container rest
        Returns:
        Waiter instance
      • areExactlyNPodsReady

        public Waiter areExactlyNPodsReady​(int n)
        Creates a waiter that checks that exactly n pods is ready in project. Uses default timeout. Tolerates any container restarts.
        Parameters:
        n - number of expected pods to wait upon
        Returns:
        Waiter instance
      • areExactlyNPodsReady

        public Waiter areExactlyNPodsReady​(int n,
                                           String dcName)
      • areExactlyNPodsReady

        public Waiter areExactlyNPodsReady​(int n,
                                           String key,
                                           String value)
        Creates a waiter that checks that exactly n pods is ready in project. Uses default timeout. Tolerates any container restarts.
        Parameters:
        n - number of expected pods to wait upon
        key - label key for pod filtering
        value - label value for pod filtering
        Returns:
        Waiter instance
      • areExactlyNPodsRunning

        public Waiter areExactlyNPodsRunning​(int n)
        Creates a waiter that checks that exactly n pods is running in project. Uses default timeout. Tolerates any container restarts.
        Parameters:
        n - number of expected pods to wait upon
        Returns:
        Waiter instance
      • areExactlyNPodsRunning

        public Waiter areExactlyNPodsRunning​(int n,
                                             String dcName)
      • areExactlyNPodsRunning

        public Waiter areExactlyNPodsRunning​(int n,
                                             String key,
                                             String value)
        Creates a waiter that checks that exactly n pods is running in project. Uses default timeout. Tolerates any container restarts.
        Parameters:
        n - number of expected pods to wait upon
        key - label key for pod filtering
        value - label value for pod filtering
        Returns:
        Waiter instance
      • areNoPodsPresent

        public Waiter areNoPodsPresent​(String dcName)
      • areNoPodsPresent

        public Waiter areNoPodsPresent​(String key,
                                       String value)
        Creates a waiter that waits until there aren't any pods in project. Uses default timeout.
        Parameters:
        key - label key for pod filtering
        value - label value for pod filtering
        Returns:
        Waiter instance
      • havePodsBeenRestarted

        public Waiter havePodsBeenRestarted​(String dcName)
      • havePodsBeenRestarted

        public Waiter havePodsBeenRestarted​(String key,
                                            String value)
      • havePodsBeenRestartedAtLeastNTimes

        public Waiter havePodsBeenRestartedAtLeastNTimes​(int times,
                                                         String dcName)
      • havePodsBeenRestartedAtLeastNTimes

        public Waiter havePodsBeenRestartedAtLeastNTimes​(int times,
                                                         String key,
                                                         String value)