Skip to content

Commit

Permalink
fix: support custom service account for autopilot (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyOT committed Jan 31, 2023
1 parent d59542c commit 52e25ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ resource "google_container_cluster" "primary" {
{% if autopilot_cluster == true %}
cluster_autoscaling {
dynamic "auto_provisioning_defaults" {
for_each = var.create_service_account ? [1] : []
for_each = (var.create_service_account || var.service_account != "") ? [1] : []

content {
service_account = local.service_account
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "google_container_cluster" "primary" {

cluster_autoscaling {
dynamic "auto_provisioning_defaults" {
for_each = var.create_service_account ? [1] : []
for_each = (var.create_service_account || var.service_account != "") ? [1] : []

content {
service_account = local.service_account
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "google_container_cluster" "primary" {

cluster_autoscaling {
dynamic "auto_provisioning_defaults" {
for_each = var.create_service_account ? [1] : []
for_each = (var.create_service_account || var.service_account != "") ? [1] : []

content {
service_account = local.service_account
Expand Down

0 comments on commit 52e25ab

Please sign in to comment.