Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1021 from kinvolk/invidian/fix-assets
Browse files Browse the repository at this point in the history
bootkube: feed output using local rather than local_file content
  • Loading branch information
invidian authored Oct 1, 2020
2 parents 2d55a8b + fff55e9 commit 1ae5de9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
16 changes: 10 additions & 6 deletions assets/terraform-modules/bootkube/assets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,8 @@ resource "local_file" "kubernetes" {
})
}

# Populate bootstrap-secrets chart values file named bootstrap-secrets.yaml.
resource "local_file" "bootstrap-secrets" {
count = var.enable_tls_bootstrap == true ? 1 : 0

filename = "${var.asset_dir}/charts/kube-system/bootstrap-secrets.yaml"
content = templatefile("${path.module}/resources/charts/bootstrap-secrets.yaml", {
locals {
bootstrap_secrets = templatefile("${path.module}/resources/charts/bootstrap-secrets.yaml", {
bootstrap_tokens = [
for token in var.bootstrap_tokens :
{
Expand All @@ -101,6 +97,14 @@ resource "local_file" "bootstrap-secrets" {
})
}

# Populate bootstrap-secrets chart values file named bootstrap-secrets.yaml.
resource "local_file" "bootstrap-secrets" {
count = var.enable_tls_bootstrap == true ? 1 : 0

filename = "${var.asset_dir}/charts/kube-system/bootstrap-secrets.yaml"
content = local.bootstrap_secrets
}

locals {
kubelet = var.disable_self_hosted_kubelet == false ? 1 : 0
}
Expand Down
2 changes: 1 addition & 1 deletion assets/terraform-modules/bootkube/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ output "lokomotive_values" {
}

output "bootstrap-secrets_values" {
value = var.enable_tls_bootstrap ? local_file.bootstrap-secrets[0].content : ""
value = var.enable_tls_bootstrap ? local.bootstrap_secrets : ""
}
Loading

0 comments on commit 1ae5de9

Please sign in to comment.