-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support passing impersonate-service-account #463
support passing impersonate-service-account #463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make changes in autogen and regenerate - https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/CONTRIBUTING.md
@@ -25,12 +25,12 @@ CLUSTER_NAME=$2 | |||
|
|||
echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..." | |||
|
|||
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)") | |||
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)") --impersonate_service_account="$impersonate_service_account" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you will need to add an argument for the $impersonate_service_account
similar to here:
terraform-google-kubernetes-engine/modules/beta-private-cluster/scripts/wait-for-cluster.sh
Line 24 in a48e6ea
CLUSTER_NAME=$2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Bharath!! I missed out this. Will fix it
@@ -25,12 +25,12 @@ CLUSTER_NAME=$2 | |||
|
|||
echo "Waiting for cluster $CLUSTER_NAME in project $PROJECT to reconcile..." | |||
|
|||
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)") | |||
current_status=$(gcloud container clusters list --project="$PROJECT" --filter=name:"$CLUSTER_NAME" --format="value(status)") --impersonate_service_account="$impersonate_service_account" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wouldn't we need to handle the case that impersonate_service_account is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this would work as expected with empty impersonate_service_account - no impersonation for the command.
This can be tested with any gcloud command, such as gcloud projects list --impersonate_service_account=""
variable "impersonate_service_account" { | ||
description = "An optional service account to impersonate. This cannot be used with credentials_path. If this service account is not specified and credentials_path is absent, the module will use Application Default Credentials." | ||
default = "" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline
variable "impersonate_service_account" { | ||
description = "An optional service account to impersonate. This cannot be used with credentials_path. If this service account is not specified and credentials_path is absent, the module will use Application Default Credentials." | ||
default = "" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline
Updated |
@morgante - Do you mind explaining what auto-gen does and how auto-gen works? |
It's explained in the contributing guide. Please read: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/CONTRIBUTING.md |
3e3c44c
to
52f0918
Compare
Hey, I have updated accordingly. Would be another chance to take a look? |
Would love to see this reviewed and merged! |
@ericyz Could you rebase/resolve conflicts? |
4beaeb7
to
6069ece
Compare
Superseded by #729 |
No description provided.