-
Notifications
You must be signed in to change notification settings - Fork 24
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
🐛 fix fetching of service accounts on gke cluster nodepool config #5149
base: main
Are you sure you want to change the base?
Conversation
Test Results3 212 tests 3 208 ✅ 1m 39s ⏱️ Results for commit bd14bf9. ♻️ This comment has been updated with latest results. |
@@ -74,7 +73,15 @@ func initGcpProjectIamServiceServiceAccount(runtime *plugin.Runtime, args map[st | |||
return args, sa, nil | |||
} | |||
} | |||
return nil, nil, errors.New("service account not found") | |||
|
|||
args["name"] = llx.NilData |
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.
why is this change needed? I think the error should be there... If we reach this point in the code, then we tried to find something that doesn't exist. Setting everything to nil will acts as if there is an actual service account with all nil fields
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.
hmm ya you're right, let me see if there's another way to do this - basically you can have references to external service accounts, which means they wont be found, and that's ok, but we still need to be able to reference it
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.
so i've tried playing around with this, but if we return the error then we block loading the rest of the information, but it's expected to have references to external service accounts
go run apps/cnquery/cnquery.go shell gcp project (prod-account) --discover gke-clusters
with the error returned, we block the rest of the output:
nquery> gcloud.project.gke.clusters { nodePools { config {*} }}
1 error occurred:
* 1 error occurred:
* 1 error occurred:
* service account not found
gcloud.project.gke.clusters: [
0: {
nodePools: 1 error occurred:
* 1 error occurred:
* service account not found
vs.
cnquery> gcloud.project.gke.clusters { nodePools { config {*} }}
gcloud.project.gke.clusters: [
0: {
nodePools: [
0: {
config: {
gcfsConfig: null
machineType: "e2-standard-4"
diskSizeGb: 50
sandboxConfig: null
....
```
Fixes: #5164 |
fixes #5133