Skip to content

Commit

Permalink
fix: correct MYSQL_DB_HOST in k8s readonly container (#278)
Browse files Browse the repository at this point in the history
* fix: change coalesce function to try

* fix: test

* fix: correct MYSQL_DB_HOST in readonly container

---------

Co-authored-by: janli <[email protected]>
  • Loading branch information
githubjianli and JianLi-Expedia authored Sep 11, 2024
1 parent d4d32e4 commit e1d451e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [7.3.9] - 2024-09-11
### Fixed
- Correct `MYSQL_DB_HOST` in readonly container.

## [7.3.8] - 2024-09-11
### Fixed
- Enable `apiary_db_para_group` only when `external_database_host` not specified.
Expand Down
4 changes: 2 additions & 2 deletions k8s-readonly.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "kubernetes_deployment_v1" "apiary_hms_readonly" {

env {
name = "MYSQL_HOST"
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.endpoint) : coalesce(var.external_database_host_readonly,var.external_database_host)
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.endpoint) : var.external_database_host
}

env {
Expand Down Expand Up @@ -113,7 +113,7 @@ resource "kubernetes_deployment_v1" "apiary_hms_readonly" {
}
env {
name = "MYSQL_DB_HOST"
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : var.external_database_host
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : coalesce(var.external_database_host_readonly,var.external_database_host)
}
env {
name = "MYSQL_DB_NAME"
Expand Down

0 comments on commit e1d451e

Please sign in to comment.