turbot/steampipe-plugin-gcp

kubernetes tables ignore `credentials` config - they use default credentials even when credentials are specified in .spc config

johnsmyth opened this issue · 0 comments

Describe the bug
kubernetes tables ignore credentials config - they use default credentials even when credentials are specified in .spc config

I'm using the GCP plugin and everything is fine.
I have a profile_4.spc file with the credentials path in it & the file exists.
But if I query kubernetes tables, I get the following error
Error: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information. (SQLSTATE HV000)
Even though I specified the credentials in my connection.

Plugin version (steampipe plugin list)
gcp 0.31.0

To reproduce
create a config that uses non-default credentials. rename or delete you default credentials. runs steampipe. You will be able to query gcp_compute_instance, but not gcp_kubernetes_cluster

Expected behavior
Should use the appropriate credentials

Additional context

Most services call setSessionConfig and then pass the opts into the NewService call - https://github.com/turbot/steampipe-plugin-gcp/blob/main/gcp/service.go#L248. For some reason, the container service calls setSessionConfig but doesnt then pass it in - https://github.com/turbot/steampipe-plugin-gcp/blob/main/gcp/service.go#L227.

See slack thread here