<p>I am trying to do rollback for a deployment config. I am not finding the rollback pointing to older image. It always points to the latest image.</p>

<p>I am trying out the following commands. </p>

<pre><code>oc rollout undo dc/&lt;name&gt;
oc rollback dc/&lt;name&gt;
oc rollback dc/&lt;name&gt; --to-version=1
</code></pre>

<p>Please help.</p>

<p>Thanks.</p>

user3930151
<p>First of all, what about check what revision is referred and what revision is remained on your project ?</p>

<ol>
<li>check how many revision can be saved in your deploymentconfig.
DeploymentConfig keeps 10 revision history by default, you can verify the current revision limits using following command.</li>
</ol>

<pre><code>$ oc get dc/&lt;your dc name&gt; -o yaml  | grep revisionHistoryLimit
  revisionHistoryLimit: 10
</code></pre>

<ol start="2">
<li>check your deploymentconfig deployment history for checking what revision can be referred
An you can also list what revision is remained, the "REVISION" number is used for "--to-version"</li>
</ol>

<pre><code>$ oc rollout history dc/&lt;your dc name&gt;
deploymentconfigs "&lt;your dc name&gt;"
REVISION    STATUS      CAUSE
1       Failed      newer deployment was found running
2       Complete    config change
3       Complete    config change
4       Complete    config change
</code></pre>

<ol start="3">
<li>check current referred revision of your deploymentconfig which shows as "(latest)".</li>
</ol>

<pre><code>$ oc describe dc/&lt;your dc name&gt;
Deployment #4 (latest):
:
Deployment #3:
:
</code></pre>

<p>I think you can find some message why you can not rollback to old revision through above checking, such as some failed deployment messages or information about that.</p>

<p>I hope it help you.</p>
