FAQ | This is a LIVE service | Changelog

Commit 12a93506 authored by Arun Patel's avatar Arun Patel Committed by Wajdi Hajji
Browse files

Change the behaviour to require image_name

parent c96e4317
......@@ -6,8 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [4.0.0] - 2021-06-29
### Changed
- Added explicit image_name to deploy. Requires existing_image_name to be valid
in the case of an also empty image_name, to avoid mis-deploying hello:latest.
- Add the requirement for an explicit image_name to deploy, which breaks previous
versions that ignored image updates.
## [3.1.1] - 2021-06-16
### Changed
......
......@@ -181,5 +181,4 @@ module "webapp" {
Originally, the module did not deploy images except on the very first use (using
`gcr.io/cloudrun/hello:latest`).
Currently, the module deploys the image from `image_name` if specified, otherwise keep the
current image, if that doesn't exist fall-back to the "hello" image.
Currently, the module deploys the image from the mandatory variable `image_name`.
......@@ -51,11 +51,4 @@ locals {
[trimsuffix(trimprefix(google_cloud_run_service.webapp.status[0].url, "https://"), "/")],
var.allow_unauthenticated_invocations ? local.dns_names : [],
)
# If a cloud run revision is present, get the full URL of the deployed image.
existing_image_name = (
data.google_cloud_run_service.webapp.template != null ?
data.google_cloud_run_service.webapp.template[0].spec[0].containers[0].image :
""
)
}
......@@ -111,11 +111,7 @@ resource "google_cloud_run_service" "webapp" {
service_account_name = google_service_account.webapp.email
containers {
image = coalesce(
var.image_name,
local.existing_image_name,
"gcr.io/cloudrun/hello:latest",
)
image = var.image_name
resources {
limits = {
......
......@@ -306,9 +306,9 @@ EOL
variable "image_name" {
type = string
default = ""
description = <<-EOL
Optional. The docker image that will be deployed. If unset, the value of
existing_image_name is preferred.
EOL
description = "The URL of the container image to be deployed."
validation {
condition = length(var.image_name) > 0
error_message = "The image_name value must be a valid URL to a container image."
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment