Skip to content

Commit

Permalink
fix: correct MYSQL_DB_HOST in readonly container
Browse files Browse the repository at this point in the history
  • Loading branch information
JianLi-Expedia committed Sep 11, 2024
1 parent 026fa6a commit 7836719
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 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) : var.external_database_host_readonly
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
2 changes: 1 addition & 1 deletion templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ locals{
})

hms_readonly_template = templatefile("${path.module}/templates/apiary-hms-readonly.json", {
mysql_db_host = "${var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : try(var.external_database_host_readonly,var.external_database_host)}"
mysql_db_host = "${var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : coalesce(var.external_database_host_readonly,var.external_database_host)}"
mysql_db_name = "${var.apiary_database_name}"
mysql_secret_arn = "${data.aws_secretsmanager_secret.db_ro_user.arn}"
hive_metastore_access_mode = "readonly"
Expand Down

0 comments on commit 7836719

Please sign in to comment.