<p>I have made a jenkins pipeline on a kubernetes cluster. </p>

<p>The problem is after pipeline runs, an image is created with a new tag. And because of that i cant hardcode the tag name in the deployment yaml file. </p>

<p>How can i pull the image with the right tag? </p>

Yasiru Dinuksha
<p>Depending upon your given statement and some assumptions, You can try to re-write the Jenkins pipeline to add one more tag:latest.</p>

<pre><code> stage('Push image') {

    docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
        app.push("${env.BUILD_NUMBER}")
        app.push("latest")
    }
</code></pre>

<p>So, I think your yaml will now always pull the latest image. I hope this solves your current problem.</p>
