From 7f7e12fb55f104e5fe3512036b3c189a6ee3ff32 Mon Sep 17 00:00:00 2001 From: rpoluri <38321430+rpoluri@users.noreply.github.com> Date: Mon, 15 Mar 2021 17:18:36 -0500 Subject: [PATCH] Feature/disable option (#81) * option to disable federated metastore during issues * fix * update readme Co-authored-by: Raj Poluri --- CHANGELOG.md | 4 ++++ README.md | 1 + templates.tf | 3 +++ templates/waggle-dance-federation-local.yml.tmpl | 2 ++ templates/waggle-dance-federation-remote.yml.tmpl | 2 ++ templates/waggle-dance-federation-ssh.yml.tmpl | 2 ++ 6 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fae19f7..36ea998 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). +## [3.2.3] - 2021-03-15 +### Changed +- Option to disable metastore to mitigate issues. + ## [3.2.2] - 2021-01-27 ### Changed - Update k8s memory limit to 120% memory request to prevent k8s from killing waggle-dance containers. diff --git a/README.md b/README.md index 110f903..e2d26f7 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ module "apiary-waggledance" { prefix = "metastore2" subnets = "subnet-3" mapped-databases = "test" + enabled = false //option to enable/disable metastore in waggle-dance without removing vpc endpoint. }, ] } diff --git a/templates.tf b/templates.tf index 9b1dbaa..539ad8e 100644 --- a/templates.tf +++ b/templates.tf @@ -56,6 +56,7 @@ data "template_file" "local_metastores_yaml" { mapped_databases = lookup(var.local_metastores[count.index], "mapped-databases", "") database_name_mapping = lookup(var.local_metastores[count.index], "database-name-mapping", "") writable_whitelist = lookup(var.local_metastores[count.index], "writable-whitelist", "") + metastore_enabled = lookup(var.local_metastores[count.index], "enabled", true) } } @@ -70,6 +71,7 @@ data "template_file" "remote_metastores_yaml" { mapped_databases = lookup(var.remote_metastores[count.index], "mapped-databases", "") database_name_mapping = lookup(var.remote_metastores[count.index], "database-name-mapping", "") writable_whitelist = lookup(var.remote_metastores[count.index], "writable-whitelist", "") + metastore_enabled = lookup(var.remote_metastores[count.index], "enabled", true) } } @@ -87,6 +89,7 @@ data "template_file" "ssh_metastores_yaml" { mapped_databases = lookup(var.ssh_metastores[count.index], "mapped-databases", "") database_name_mapping = lookup(var.ssh_metastores[count.index], "database-name-mapping", "") writable_whitelist = lookup(var.ssh_metastores[count.index], "writable-whitelist", "") + metastore_enabled = lookup(var.ssh_metastores[count.index], "enabled", true) } } diff --git a/templates/waggle-dance-federation-local.yml.tmpl b/templates/waggle-dance-federation-local.yml.tmpl index 6688bfb..3f0bae5 100644 --- a/templates/waggle-dance-federation-local.yml.tmpl +++ b/templates/waggle-dance-federation-local.yml.tmpl @@ -1,3 +1,4 @@ +%{if metastore_enabled~} - name: ${prefix} access-control-type: ${ writable_whitelist == "" ? "READ_ONLY" : "READ_AND_WRITE_ON_DATABASE_WHITELIST" } database-prefix: ${prefix}_ @@ -8,3 +9,4 @@ ${ database_name_mapping == "" ? "" : " database-name-mapping:" } ${ database_name_mapping == "" ? "" : join("\n", formatlist(" %s", split(",", replace(replace(database_name_mapping, " ", ""), ":", ": ")))) } ${ writable_whitelist == "" ? "" : " writable-database-white-list:" } ${ writable_whitelist == "" ? "" : join("\n",formatlist(" - %s",split(",",writable_whitelist))) } +%{~endif} diff --git a/templates/waggle-dance-federation-remote.yml.tmpl b/templates/waggle-dance-federation-remote.yml.tmpl index 6688bfb..3f0bae5 100644 --- a/templates/waggle-dance-federation-remote.yml.tmpl +++ b/templates/waggle-dance-federation-remote.yml.tmpl @@ -1,3 +1,4 @@ +%{if metastore_enabled~} - name: ${prefix} access-control-type: ${ writable_whitelist == "" ? "READ_ONLY" : "READ_AND_WRITE_ON_DATABASE_WHITELIST" } database-prefix: ${prefix}_ @@ -8,3 +9,4 @@ ${ database_name_mapping == "" ? "" : " database-name-mapping:" } ${ database_name_mapping == "" ? "" : join("\n", formatlist(" %s", split(",", replace(replace(database_name_mapping, " ", ""), ":", ": ")))) } ${ writable_whitelist == "" ? "" : " writable-database-white-list:" } ${ writable_whitelist == "" ? "" : join("\n",formatlist(" - %s",split(",",writable_whitelist))) } +%{~endif} diff --git a/templates/waggle-dance-federation-ssh.yml.tmpl b/templates/waggle-dance-federation-ssh.yml.tmpl index c262674..890f07b 100644 --- a/templates/waggle-dance-federation-ssh.yml.tmpl +++ b/templates/waggle-dance-federation-ssh.yml.tmpl @@ -1,3 +1,4 @@ +%{if metastore_enabled~} - name: ${prefix} access-control-type: ${ writable_whitelist == "" ? "READ_ONLY" : "READ_AND_WRITE_ON_DATABASE_WHITELIST" } database-prefix: ${prefix}_ @@ -14,3 +15,4 @@ ${ database_name_mapping == "" ? "" : " database-name-mapping:" } ${ database_name_mapping == "" ? "" : join("\n", formatlist(" %s", split(",", replace(replace(database_name_mapping, " ", ""), ":", ": ")))) } ${ writable_whitelist == "" ? "" : " writable-database-white-list:" } ${ writable_whitelist == "" ? "" : join("\n",formatlist(" - %s",split(",",writable_whitelist))) } +%{~endif}