I have a continuous deployment pipeline setup with Github via Cloud Build Triggers. Each time a push is made to the main branch, the cloudbuild.yaml does its thing and produces a digest with a tag of latest
. All of my digests are stored in Artifact Registry. Is there anyway to get Cloud Run to always use the digest tagged as latest
? During the setup of my Cloud Run service this seems to be the case but after the service has been created, the image ends up resolving to a SHA value ie a specific digest rather than the tag.
Asked
Active
Viewed 570 times
-1

prismo
- 1,505
- 2
- 12
- 26
-
Could you please clarify what do you mean by saying «to get Cloud Run to always use the digest tagged as latest»? If you mean run build -> publish «latest» artifact -> deploy the «latest» version, literally it's what you have at the moment, don't you? Whatever, adding more information like your cloud build / run configs are welcome here. – igops Dec 06 '22 at 09:41
1 Answers
2
When you deploy a revision on Cloud Run, the LASTEST version of the image is used and cached on Cloud Run infrastructure.
If your CI/CD pipeline generate other container images, with the LATEST tag (but it's also true with defined tag), Cloud Run DOES NOT reload its cache. You have to deploy a new revision to update that cache.
Therefore, at the end of your pipeline add a cloud run deployment to update the container version.

guillaume blaquiere
- 66,369
- 2
- 47
- 76