Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vjeffrey
Copy link
Contributor

fixes #5133

Copy link
Contributor

github-actions bot commented Jan 31, 2025

Test Results

3 212 tests   3 208 ✅  1m 39s ⏱️
  385 suites      4 💤
   29 files        0 ❌

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
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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
          ....
         ```

@mm-weber
Copy link
Contributor

mm-weber commented Feb 4, 2025

Fixes: #5164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime error: during discovery (rate limiting issue?)
3 participants