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: instances column of gcp_compute_instance_group errors for regional groups #670

Merged

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Oct 19, 2024

Without this change, the instances column of the gcp_compute_instance_group table triggers an error for regional instance groups:

# steampipe query
Welcome to Steampipe v0.24.2
For more information, type .help
> select name, instances, region_name, zone_name from gcp_compute_instance_group

Error: gcp: googleapi: Error 400: Invalid value for field 'zone': ''. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)', invalid (SQLSTATE HV000)

+------------------------------------------------------+-----------+-------------+----------------+
| name                                                 | instances | region_name | zone_name      |
+------------------------------------------------------+-----------+-------------+----------------+
| pdecat-managed-instance-group-stateful-zonal-single  | <null>    |             | europe-west9-a |
| pdecat-managed-instance-group-stateless-zonal-single | <null>    |             | europe-west9-a |
| pdecat-unmanaged-instance-group-zonal-single         | <null>    |             | europe-west9-a |
+------------------------------------------------------+-----------+-------------+----------------+

With this change:

# steampipe query
Welcome to Steampipe v0.24.2
For more information, type .help
> select name, instances, region_name, zone_name from gcp_compute_instance_group
+--------------------------------------------------------+-----------+--------------+----------------+
| name                                                   | instances | region_name  | zone_name      |
+--------------------------------------------------------+-----------+--------------+----------------+
| pdecat-managed-instance-group-stateless-zonal-single   | <null>    |              | europe-west9-a |
| pdecat-unmanaged-instance-group-zonal-single           | <null>    |              | europe-west9-a |
| pdecat-managed-instance-group-stateful-zonal-multiple  | <null>    | europe-west9 |                |
| pdecat-managed-instance-group-stateful-zonal-single    | <null>    |              | europe-west9-a |
| pdecat-managed-instance-group-stateless-zonal-multiple | <null>    | europe-west9 |                |
+--------------------------------------------------------+-----------+--------------+----------------+

Note: instances values are null because all my test instance groups have 0 instances.

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
Add example SQL query results here (please include the input queries as well)

@pdecat pdecat force-pushed the fix/gcp_compute_instance_group_regional branch from d05048c to 882760c Compare October 21, 2024 07:22
@misraved misraved added the hacktoberfest-accepted This pull request has been accepted for Hacktoberfest label Oct 22, 2024
@misraved misraved merged commit 378ac45 into turbot:main Oct 28, 2024
1 check passed
@pdecat pdecat deleted the fix/gcp_compute_instance_group_regional branch October 28, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted This pull request has been accepted for Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants