Package cz.xtf.core.openshift
Class OpenShiftWaiters
- java.lang.Object
-
- cz.xtf.core.openshift.OpenShiftWaiters
-
public class OpenShiftWaiters extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WaiterareExactlyNPodsReady(int n)Creates a waiter that checks that exactly n pods is ready in project.WaiterareExactlyNPodsReady(int n, String dcName)WaiterareExactlyNPodsReady(int n, String key, String value)Creates a waiter that checks that exactly n pods is ready in project.WaiterareExactlyNPodsRunning(int n)Creates a waiter that checks that exactly n pods is running in project.WaiterareExactlyNPodsRunning(int n, String dcName)WaiterareExactlyNPodsRunning(int n, String key, String value)Creates a waiter that checks that exactly n pods is running in project.WaiterareNoPodsPresent(String dcName)WaiterareNoPodsPresent(String key, String value)Creates a waiter that waits until there aren't any pods in project.static OpenShiftWaitersget(OpenShift openShift, FailFastCheck failFast)WaiterhasBuildCompleted(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 settingxtf.waiting.build.timeout), 5 seconds interval check and both logging points.WaiterhasBuildCompleted(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 settingxtf.waiting.build.timeout), 5 seconds interval check and both logging points.WaiterhavePodsBeenRestarted(String dcName)WaiterhavePodsBeenRestarted(String key, String value)WaiterhavePodsBeenRestartedAtLeastNTimes(int times, String dcName)WaiterhavePodsBeenRestartedAtLeastNTimes(int times, String key, String value)WaiterisDcReady(String dcName)Creates a waiter object waiting till all pods created by deployment config with namedcNameare ready.WaiterisDcReady(String dcName, int restartTolerance)Creates a waiter object that waits till all pods created by deployment config with namedcNameare ready.WaiterisDeploymentReady(String dcName, int version)Creates a waiter object that waits till all pods created by deployment config with namedcNameare ready.WaiterisDeploymentReady(String dcName, int version, int restartTolerance)Creates a waiter object that waits till all pods created by deployment config with namedcNameare ready.WaiterisLatestBuildPresent(String buildConfigName)Creates waiter for latest build presence with default timeout, 5 seconds interval check and both logging points.WaiterisProjectClean()Creates waiter for clean project with 20 seconds timeout.WaiterisProjectReady()Create waiter for project to created with 20 seconds timeout.
-
-
-
Method Detail
-
get
public static OpenShiftWaiters get(OpenShift openShift, FailFastCheck failFast)
- Parameters:
openShift- openshift clientfailFast-BooleanSupplierthat 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 settingxtf.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 settingxtf.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 namedcNameare 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 namedcNameare ready. ToleratesrestartToleracecontainer restarts. Uses default timeout.- Parameters:
dcName- name of deploymentConfigrestartTolerance- 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 namedcNameare ready. Tolerates any container restarts. Uses default timeout.- Parameters:
dcName- name of deploymentConfigversion- 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 namedcNameare ready. Tolerates any container restarts. Uses default timeout.- Parameters:
dcName- name of deploymentConfigversion- deployment versionrestartTolerance- 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 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 uponkey- label key for pod filteringvalue- 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 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 uponkey- label key for pod filteringvalue- label value for pod filtering- Returns:
- Waiter instance
-
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 filteringvalue- label value for pod filtering- Returns:
- Waiter instance
-
havePodsBeenRestartedAtLeastNTimes
public Waiter havePodsBeenRestartedAtLeastNTimes(int times, String dcName)
-
-