Skip to content

Commit 8c21234

Browse files
authored
Add single quotes for empty federation prefixes (#153)
* test new vars * test * test * changelog * add in other places
1 parent 8d13a71 commit 8c21234

7 files changed

+18
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
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).
55

6+
## [4.6.2] - 2025-02-12
7+
### Added
8+
- Use single quotes when empty to instantiate empty prefix.
9+
610
## [4.6.1] - 2025-02-11
711
### Added
812
- Added variable `primary_metastore_database_prefix` to configure primary metastore database prefix.

templates.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ data "template_file" "local_metastores_yaml" {
6363
vars = {
6464
prefix = var.local_metastores[count.index].prefix
6565
metastore_host = var.local_metastores[count.index].host
66+
name = lookup(var.local_metastores[count.index], "name", "")
6667
metastore_port = lookup(var.local_metastores[count.index], "port", "9083")
6768
mapped_databases = lookup(var.local_metastores[count.index], "mapped-databases", "")
6869
mapped_tables = lookup(var.local_metastores[count.index], "mapped-tables", "")
@@ -81,6 +82,7 @@ data "template_file" "remote_metastores_yaml" {
8182
vars = {
8283
prefix = var.remote_metastores[count.index].prefix
8384
metastore_host = aws_vpc_endpoint.remote_metastores[count.index].dns_entry[0].dns_name
85+
name = lookup(var.remote_metastores[count.index], "name", "")
8486
metastore_port = lookup(var.remote_metastores[count.index], "port", "9083")
8587
mapped_databases = lookup(var.remote_metastores[count.index], "mapped-databases", "")
8688
mapped_tables = lookup(var.remote_metastores[count.index], "mapped-tables", "")
@@ -99,6 +101,7 @@ data "template_file" "remote_region_metastores_yaml" {
99101
vars = {
100102
prefix = var.remote_region_metastores[count.index].prefix
101103
metastore_host = aws_vpc_endpoint.remote_region_metastores[var.remote_region_metastores[count.index]["endpoint"]].dns_entry[0].dns_name
104+
name = lookup(var.remote_region_metastores[count.index], "name", "")
102105
metastore_port = lookup(var.remote_region_metastores[count.index], "port", "9083")
103106
mapped_databases = lookup(var.remote_region_metastores[count.index], "mapped-databases", "")
104107
mapped_tables = lookup(var.remote_region_metastores[count.index], "mapped-tables", "")
@@ -119,6 +122,7 @@ data "template_file" "ssh_metastores_yaml" {
119122
prefix = lookup(var.ssh_metastores[count.index], "prefix")
120123
bastion_host = lookup(var.ssh_metastores[count.index], "bastion-host")
121124
metastore_host = lookup(var.ssh_metastores[count.index], "metastore-host")
125+
name = lookup(var.ssh_metastores[count.index], "name", "")
122126
metastore_port = lookup(var.ssh_metastores[count.index], "port")
123127
user = lookup(var.ssh_metastores[count.index], "user")
124128
timeout = lookup(var.ssh_metastores[count.index], "timeout", "60000")
@@ -139,6 +143,7 @@ data "template_file" "glue_metastores_yaml" {
139143
prefix = lookup(var.glue_metastores[count.index], "prefix")
140144
glue_account_id = lookup(var.glue_metastores[count.index], "glue-account-id")
141145
glue_endpoint = lookup(var.glue_metastores[count.index], "glue-endpoint")
146+
name = lookup(var.glue_metastores[count.index], "name", "")
142147
mapped_databases = lookup(var.glue_metastores[count.index], "mapped-databases", "")
143148
mapped_tables = lookup(var.glue_metastores[count.index], "mapped-tables", "")
144149
database_name_mapping = lookup(var.glue_metastores[count.index], "database-name-mapping", "")

templates/waggle-dance-federation-glue.yml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%{if metastore_enabled~}
2-
- name: ${prefix}
2+
- name: ${ name == "" ? "prefix" : "name" }
33
access-control-type: ${ writable_whitelist == "" ? "READ_ONLY" : "READ_AND_WRITE_ON_DATABASE_WHITELIST" }
4-
database-prefix: ${prefix}_
4+
database-prefix: '${ prefix == "" ? "" : "prefix_" }'
55
glue-config:
66
glue-account-id: ${glue_account_id}
77
glue-endpoint: ${glue_endpoint}

templates/waggle-dance-federation-local.yml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%{if metastore_enabled~}
2-
- name: ${prefix}
2+
- name: ${ name == "" ? "prefix" : "name" }
33
access-control-type: ${ writable_whitelist == "" ? "READ_ONLY" : "READ_AND_WRITE_ON_DATABASE_WHITELIST" }
4-
database-prefix: ${prefix}_
4+
database-prefix: '${ prefix == "" ? "" : "prefix_" }'
55
remote-meta-store-uris: thrift://${metastore_host}:${metastore_port}
66
latency: ${latency}
77
%{if enable_path_conversion ~}

templates/waggle-dance-federation-remote.yml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%{if metastore_enabled~}
2-
- name: ${prefix}
2+
- name: ${ name == "" ? "prefix" : "name" }
33
access-control-type: ${ writable_whitelist == "" ? "READ_ONLY" : "READ_AND_WRITE_ON_DATABASE_WHITELIST" }
4-
database-prefix: ${prefix}_
4+
database-prefix: '${ prefix == "" ? "" : "prefix_" }'
55
remote-meta-store-uris: thrift://${metastore_host}:${metastore_port}
66
latency: ${latency}
77
%{if enable_path_conversion ~}

templates/waggle-dance-federation-ssh.yml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%{if metastore_enabled~}
2-
- name: ${prefix}
2+
- name: ${ name == "" ? "prefix" : "name" }
33
access-control-type: ${ writable_whitelist == "" ? "READ_ONLY" : "READ_AND_WRITE_ON_DATABASE_WHITELIST" }
4-
database-prefix: ${prefix}_
4+
database-prefix: ${ prefix == "" ? '' : "prefix_" }
55
remote-meta-store-uris: thrift://${metastore_host}:${metastore_port}
66
latency: ${latency}
77
metastore-tunnel:

templates/waggle-dance-federation.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
primary-meta-store:
22
access-control-type: ${primary_metastore_access_type}
3-
database-prefix: ${primary_metastore_database_prefix}_
3+
database-prefix: '${ primary_metastore_database_prefix == "" ? "" : "primary_metastore_database_prefix_" }'
44
name: primary
55
%{if primary_metastore_glue_account_id != "" ~}
66
glue-config:

0 commit comments

Comments
 (0)