FAQ | This is a LIVE service | Changelog

Commit 4f6113a1 authored by Wajdi Hajji's avatar Wajdi Hajji
Browse files

Updated CHANGELOG

parent 12a93506
......@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [4.0.1] - 2021-07-15
### Changed
- Support load balancer ingress style alongside Cloud Run domain mapping.
## [4.0.0] - 2021-06-29
### Changed
- Add the requirement for an explicit image_name to deploy, which breaks previous
......
......@@ -181,4 +181,18 @@ 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 the mandatory variable `image_name`.
Currently, deploy the image from `image_name` if specified, otherwise keep the
current image, if that doesn't exist fall-back to the "hello" image.
The name of the currently deployed image needs to be sourced outside of
this module and supplied as `existing_image_name` to prevent a cyclic dependency
problem. This can be extracted from an existing deployment and included in the
root module with:
```tf
existing_image_name = (
data.google_cloud_run_service.webapp.template != null ?
data.google_cloud_run_service.webapp.template[0].spec[0].containers[0].image :
""
)
```
......@@ -51,7 +51,7 @@ resource "google_cloud_run_service" "webapp" {
# Specify the allowable ingress types.
{
"run.googleapis.com/ingress" : local.webapp_allowed_ingress,
"run.googleapis.com/ingress" : locals.webapp_allowed_ingress,
},
var.service_annotations,
......@@ -111,7 +111,11 @@ resource "google_cloud_run_service" "webapp" {
service_account_name = google_service_account.webapp.email
containers {
image = var.image_name
image = coalesce(
var.image_name,
var.existing_image_name,
"gcr.io/cloudrun/hello:latest",
)
resources {
limits = {
......
......@@ -306,9 +306,18 @@ EOL
variable "image_name" {
type = string
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."
}
default = ""
description = <<-EOL
The docker image that will be deployed. If unset, the value of existing_image_name
is preferred.
EOL
}
variable "existing_image_name" {
type = string
default = ""
description = <<-EOL
The image currently deployed, which needs to be passed into this module to
avoid a cyclic dependency. If unset, the hello container will be deployed.
EOL
}
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