Java Code Examples for io.fabric8.openshift.api.model.DeploymentConfig#getStatus()
The following examples show how to use
io.fabric8.openshift.api.model.DeploymentConfig#getStatus() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OpenShiftServiceImpl.java From syndesis with Apache License 2.0 | 6 votes |
@Override public boolean isScaled(String name, int desiredMinimumReplicas, Map<String, String> labels) { List<DeploymentConfig> deploymentConfigs = getDeploymentsByLabel(labels); if (deploymentConfigs.isEmpty()) { return false; } DeploymentConfig dc = deploymentConfigs.get(0); int allReplicas = 0; int availableReplicas = 0; if (dc != null && dc.getStatus() != null) { DeploymentConfigStatus status = dc.getStatus(); allReplicas = nullSafe(status.getReplicas()); availableReplicas = nullSafe(status.getAvailableReplicas()); } return desiredMinimumReplicas <= allReplicas && desiredMinimumReplicas <= availableReplicas; }
Example 2
Source File: Readiness.java From kubernetes-client with Apache License 2.0 | 6 votes |
public static boolean isDeploymentConfigReady(DeploymentConfig d) { Utils.checkNotNull(d, "Deployment can't be null."); DeploymentConfigSpec spec = d.getSpec(); DeploymentConfigStatus status = d.getStatus(); if (status == null || status.getReplicas() == null || status.getAvailableReplicas() == null) { return false; } //Can be true in testing, so handle it to make test writing easier. if (spec == null || spec.getReplicas() == null) { return false; } return spec.getReplicas().intValue() == status.getReplicas() && spec.getReplicas().intValue() <= status.getAvailableReplicas(); }
Example 3
Source File: DeploymentConfigOperator.java From strimzi-kafka-operator with Apache License 2.0 | 5 votes |
/** * Retrieves the Progressing condition from the DeploymentConfig status * * @param dep DeploymentConfig resource * @return Progressing condition */ private DeploymentCondition getProgressingCondition(DeploymentConfig dep) { if (dep.getStatus() != null && dep.getStatus().getConditions() != null) { return dep.getStatus().getConditions().stream().filter(condition -> "Progressing".equals(condition.getType())).findFirst().orElse(null); } else { return null; } }