Search in sources :

Example 1 with DeploymentConfigStatus

use of io.fabric8.openshift.api.model.DeploymentConfigStatus in project syndesis by syndesisio.

the class OpenShiftServiceImpl method isScaled.

@Override
public boolean isScaled(String name, int desiredReplicas) {
    String sName = openshiftName(name);
    DeploymentConfig dc = openShiftClient.deploymentConfigs().withName(sName).get();
    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 desiredReplicas == allReplicas && desiredReplicas == availableReplicas;
}
Also used : DeploymentConfigStatus(io.fabric8.openshift.api.model.DeploymentConfigStatus) DeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig)

Aggregations

DeploymentConfig (io.fabric8.openshift.api.model.DeploymentConfig)1 DeploymentConfigStatus (io.fabric8.openshift.api.model.DeploymentConfigStatus)1