<p>I am  running below command to restart pods , but i could able to patch one deployment at a time, requirement is to patch all the deployments in namespace at a time.</p>
<pre><code>  oc patch deploy  buy-api  -p &quot;{\&quot;spec\&quot;:{\&quot;template\&quot;:{\&quot;metadata\&quot;:{\&quot;annotations\&quot;:{\&quot;date\&quot;:\&quot;`date +'%s'`\&quot;}}}}}&quot;
</code></pre>
<p>Could somebody help me to find command to apply patch for all the deployments in one shot.</p>
<p>Thanks in Advance</p>

ramesh reddy
<p>Using awk and xargs you can do that:</p>
<pre><code>oc get deploy | awk '{print $1 }' | xargs oc patch deploy $0  -p &quot;{\&quot;spec\&quot;:{\&quot;template\&quot;:{\&quot;metadata\&quot;:{\&quot;annotations\&quot;:{\&quot;date\&quot;:\&quot;`date +'%s'`\&quot;}}}}}&quot;
</code></pre>
