Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Triggering a deployment in OpenShift with an external image

Tags:

openshift

I'm attempting to trigger a deployment when an image is updated in OpenShift. The image is hosted in a private external docker registry. I've created an ImageStream that maps to this external image. When I push a new image to the registry, I'd expect the ImageStream to pick up the change somehow and update itself. However, when the external image is updated, the change is not immediately propagated to the ImageStream. How can I keep the ImageStream in sync with the image in our external registry?

I'm aware that I can tag the image with the --scheduled=true flag to have the image periodically refreshed. The problem is that periodically isn't good enough. Is there a way to sync the changes immediately?

like image 488
banjeremy Avatar asked Oct 18 '22 00:10

banjeremy


1 Answers

One way to have it updated immediately and trigger a new build, is to run:

oc import-image imagestreamname

If the image on remote registry has changed, this will result in image stream tags being updated, which will then trigger re-builds of anything dependent on the tag, if the tag was updated.

like image 57
Graham Dumpleton Avatar answered Oct 28 '22 15:10

Graham Dumpleton