Skip to content

Commit 14a0536

Browse files
authored
fix: Removed dependency to obsolete template_file by upgrading to templatefile (#1119)
* feat(auth): change template_file to templatefile * fix(auth): update value to follow terraform fmt
1 parent a030360 commit 14a0536

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

modules/auth/main.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,3 @@ data "google_container_cluster" "gke_cluster" {
3030
}
3131

3232
data "google_client_config" "provider" {}
33-
34-
data "template_file" "kubeconfig" {
35-
template = file("${path.module}/templates/kubeconfig-template.yaml.tpl")
36-
37-
vars = {
38-
context = local.context
39-
cluster_ca_certificate = local.cluster_ca_certificate
40-
endpoint = local.endpoint
41-
token = data.google_client_config.provider.access_token
42-
}
43-
}

modules/auth/outputs.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
output "kubeconfig_raw" {
2020
sensitive = true
2121
description = "A kubeconfig file configured to access the GKE cluster."
22-
value = data.template_file.kubeconfig.rendered
22+
value = templatefile("${path.module}/templates/kubeconfig-template.yaml.tpl", {
23+
context = local.context
24+
cluster_ca_certificate = local.cluster_ca_certificate
25+
endpoint = local.endpoint
26+
token = data.google_client_config.provider.access_token
27+
})
2328
}
2429

2530
# Terraform providers (kubernetes, helm)

0 commit comments

Comments
 (0)