@Override public DeploymentConfig scale(int count, boolean wait) { DeploymentConfig deployment = cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); if (wait) { waitUntilDeploymentConfigIsScaled(count); deployment = getMandatory(); } return deployment; }
@Override public boolean reap() { DeploymentConfig deployment = operation.cascading(false).edit().editSpec().withReplicas(0).endSpec().done(); //TODO: These checks shouldn't be used as they are not realistic. We just use them to support mock/crud tests. Need to find a cleaner way to do so. if (deployment.getStatus() != null) { waitForObservedGeneration(deployment.getStatus().getObservedGeneration()); } //We are deleting the DC before reaping the replication controller, because the RC's won't go otherwise. Boolean reaped = operation.cascading(false).delete(); // Waiting for the DC to be completely deleted before removing the replication controller (error in Openshift 3.9) waitForDeletion(); Map<String, String> selector = new HashMap<>(); selector.put(DEPLOYMENT_CONFIG_REF, deployment.getMetadata().getName()); if (selector != null && !selector.isEmpty()) { Boolean deleted = new ReplicationControllerOperationsImpl(client, operation.getConfig(), operation.getNamespace()) .withLabels(selector) .delete(); } return reaped; }
@Override public DeploymentConfig deployLatest(boolean wait) { Long currentVersion = getMandatory().getStatus().getLatestVersion(); if(currentVersion == null){ currentVersion = 1L; } DeploymentConfig deployment = cascading(false).edit().editStatus().withLatestVersion(++currentVersion).endStatus().done(); if (wait) { waitUntilDeploymentConfigIsScaled(deployment.getSpec().getReplicas()); deployment = getMandatory(); } return deployment; }
@Override public void scale(String name, int desiredReplicas) { final String sName = Names.sanitize(name); LOGGER.debug("Scale {}", sName); openShiftClient.deploymentConfigs().withName(sName).edit() .editSpec() .withReplicas(desiredReplicas) .endSpec() .done(); }
@Override public DeploymentConfig scale(int count, boolean wait) { DeploymentConfig deployment = cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); if (wait) { waitUntilDeploymentConfigIsScaled(count); deployment = getMandatory(); } return deployment; }
.endTemplate() .endSpec() .done());
@Override public boolean reap() { DeploymentConfig deployment = operation.cascading(false).edit().editSpec().withReplicas(0).endSpec().done(); //TODO: These checks shouldn't be used as they are not realistic. We just use them to support mock/crud tests. Need to find a cleaner way to do so. if (deployment.getStatus() != null) { waitForObservedGeneration(deployment.getStatus().getObservedGeneration()); } //We are deleting the DC before reaping the replication controller, because the RC's won't go otherwise. Boolean reaped = operation.cascading(false).delete(); // Waiting for the DC to be completely deleted before removing the replication controller (error in Openshift 3.9) waitForDeletion(); Map<String, String> selector = new HashMap<>(); selector.put(DEPLOYMENT_CONFIG_REF, deployment.getMetadata().getName()); if (selector != null && !selector.isEmpty()) { Boolean deleted = new ReplicationControllerOperationsImpl(client, operation.getConfig(), operation.getNamespace()) .withLabels(selector) .delete(); } return reaped; }
@Override public DeploymentConfig deployLatest(boolean wait) { Long currentVersion = getMandatory().getStatus().getLatestVersion(); if(currentVersion == null){ currentVersion = 1L; } DeploymentConfig deployment = cascading(false).edit().editStatus().withLatestVersion(++currentVersion).endStatus().done(); if (wait) { waitUntilDeploymentConfigIsScaled(deployment.getSpec().getReplicas()); deployment = getMandatory(); } return deployment; }
.endTrigger() .endSpec() .done();
.endTrigger() .endSpec() .done();