@Override public Deployment patch(Deployment item) { if (isCascading()) { return cascading(false).patch(item); } return super.patch(item); }
@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 Deployment replace(Deployment item) { if (isCascading()) { return cascading(false).replace(item); } return super.replace(item); }
@Override public DoneableDeployment edit() { if (isCascading()) { return cascading(false).edit(); } return super.edit(); }
delegate.deploymentConfigs().inNamespace(prjName).withName(svcName).cascading(true).delete(); if (appName != null) { delegate.services().inNamespace(prjName).withLabel(APP_LABEL, appName).delete();
@Override public DoneableDeploymentConfig edit() { if (isCascading()) { return cascading(false).edit(); } return super.edit(); }
@Override ReplicaSet withReplicas(int count) { return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); }
D editable = resources().inNamespace(namespace).withName(oldName).cascading(false).edit(); updateDeploymentKey(editable, oldDeploymentHash); oldObj = editable.done(); resources().inNamespace(namespace).withName(newName).cascading(false).delete(); editable = resources().inNamespace(namespace).withName(createdObj.getMetadata().getName()).cascading(false).edit(); removeDeploymentKey(editable); createdObj = editable.done();
@Override public DeploymentConfig patch(DeploymentConfig item) { if (isCascading()) { return cascading(false).patch(item); } return super.patch(item); }
@Override public DeploymentConfig replace(DeploymentConfig item) { if (isCascading()) { return cascading(false).replace(item); } return super.replace(item); }
@Override StatefulSet withReplicas(int count) { return cascading(false).edit().editSpec().withReplicas(count).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; }
protected Future<ReconcileResult<T>> internalPatch(String namespace, String name, T current, T desired, boolean cascading) { try { T result = operation().inNamespace(namespace).withName(name).cascading(cascading).patch(desired); log.debug("{} {} in namespace {} has been patched", resourceKind, name, namespace); return Future.succeededFuture(wasChanged(current, result) ? ReconcileResult.patched(result) : ReconcileResult.noop(result)); } catch (Exception e) { log.error("Caught exception while patching {} {} in namespace {}", resourceKind, name, namespace, e); return Future.failedFuture(e); } }
@Override public DeploymentConfig replace(DeploymentConfig item) { if (isCascading()) { return cascading(false).replace(item); } return super.replace(item); }
@Override ReplicationController withReplicas(int count) { return cascading(false).edit().editSpec().withReplicas(count).endSpec().done(); }
D editable = resources().inNamespace(namespace).withName(oldName).cascading(false).edit(); updateDeploymentKey(editable, oldDeploymentHash); oldObj = editable.done(); resources().inNamespace(namespace).withName(newName).cascading(false).delete(); editable = resources().inNamespace(namespace).withName(createdObj.getMetadata().getName()).cascading(false).edit(); removeDeploymentKey(editable); createdObj = editable.done();
@Override public DeploymentConfig patch(DeploymentConfig item) { if (isCascading()) { return cascading(false).patch(item); } return super.patch(item); }
@Override public Deployment replace(Deployment item) { if (isCascading()) { return cascading(false).replace(item); } return super.replace(item); }
@Override public Job scale(int count, boolean wait) { Job res = cascading(false).edit().editSpec().withParallelism(count).endSpec().done(); if (wait) { waitUntilJobIsScaled(); res = getMandatory(); } return res; }
@Override public Deployment patch(Deployment item) { if (isCascading()) { return cascading(false).patch(item); } return super.patch(item); }