Skip to content

Commit

Permalink
fix: Removed dependency to obsolete template_file by upgrading to tem…
Browse files Browse the repository at this point in the history
…platefile (#1119)

* feat(auth): change template_file to templatefile

* fix(auth): update value to follow terraform fmt
  • Loading branch information
mrako committed Jan 10, 2022
1 parent a030360 commit 14a0536
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
11 changes: 0 additions & 11 deletions modules/auth/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,3 @@ data "google_container_cluster" "gke_cluster" {
}

data "google_client_config" "provider" {}

data "template_file" "kubeconfig" {
template = file("${path.module}/templates/kubeconfig-template.yaml.tpl")

vars = {
context = local.context
cluster_ca_certificate = local.cluster_ca_certificate
endpoint = local.endpoint
token = data.google_client_config.provider.access_token
}
}
7 changes: 6 additions & 1 deletion modules/auth/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
output "kubeconfig_raw" {
sensitive = true
description = "A kubeconfig file configured to access the GKE cluster."
value = data.template_file.kubeconfig.rendered
value = templatefile("${path.module}/templates/kubeconfig-template.yaml.tpl", {
context = local.context
cluster_ca_certificate = local.cluster_ca_certificate
endpoint = local.endpoint
token = data.google_client_config.provider.access_token
})
}

# Terraform providers (kubernetes, helm)
Expand Down

0 comments on commit 14a0536

Please sign in to comment.