<p>Is there a way to delete previous deployments with cli?</p>

<p>When I successfully run <code>oc import-image $APPLICATION</code> a new deployment appears with a RC and after a few runs I hit the RC max and will have to manually delete the previous deployments.</p>

<p>Is there a script similar to <code>oc delete rc $APPLICATION-$(($DEPLOYMENT_NUMBER - 1))</code>?</p>

<p>Over time you can end up with alot of replication controllers, and thus you need to clean them out. You can use <code>oc delete rc &lt;rc-num&gt;</code> or even better <code>oc adm prune</code> to do this. Checkout <code>oc adm options</code> and <code>oc adm prune --help</code> for options.</p>

<p><code>
$ oc adm prune deployments --keep-complete=5 --namespace=myproject --confirm
</code></p>
