Skip to content

Commit

Permalink
Fix database secret name and namespace retrieval to handle hyphens co…
Browse files Browse the repository at this point in the history
…rrectly
  • Loading branch information
Stevesibilia committed Nov 29, 2024
1 parent e26dde8 commit 4c8532a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ locals {
database_secrets_map = {
for p in var.drupal_projects_list : "${p.project_name}-${p.gitlab_project_id}-${p.release_branch_name}" => {
secret_name = try(
kubernetes_secret.database_secret_name["${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp"].metadata[0].name,
kubernetes_secret.database_secret_name[replace("${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp", "-", "_")].metadata[0].name,
null)
namespace = try(
kubernetes_secret.database_secret_name["${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp"].metadata[0].namespace,
kubernetes_secret.database_secret_name[replace("${p.project_name}_${p.gitlab_project_id}_${p.release_branch_name}_dp", "-", "_")].metadata[0].namespace,
null
)
}
Expand Down

0 comments on commit 4c8532a

Please sign in to comment.