Your application images are built using Cloud Build and pushed to Google Container Registry (GCR). You want to be able to specify a particular version of your application for deployment based on the release version tagged in source control. What should you do when you push the image?
A. Reference the image digest in the source control tag.
B. Supply the source control tag as a parameter within the image name.
C. Use Cloud Build to include the release version tag in the application image.
D. Use GCR digest versioning to match the image to the tag in source control.
Disclaimer
This is a practice question. There is no guarantee of coming this question in the certification exam.
Answer
C
Explanation
Both option B and C are valid ways to ensure that a specific version of an application is deployed based on the release version tagged in source control, but option C is likely to be the more robust and flexible solution for managing your application deployments.
With option B, Supply the source control tag as a parameter within the image name, you have to manually include the source control tag when you push the image to GCR. This can make it more prone to human error and also could require more manual work to keep track of the different versions and their correspondence with the codebase.
On the other hand, option C, Use Cloud Build to include the release version tag in the application image, allows you to automate the process of adding the release version tag to the application image during the build process. This can make it easier to track the different versions of your application and their association with the codebase. Additionally, Cloud Build allows you to automate different steps of the build and deployment process, such as building, testing and deploying the images, making it easier to manage and keep track of your deployments.
A. Reference the image digest in the source control tag.
(Not an option.)
B. Supply the source control tag as a parameter within the image name.
C. Use Cloud Build to include the release version tag in the application image.
D. Use GCR digest versioning to match the image to the tag in source control.
(Not an option.)