turbot / steampipe-plugin-gcp

Use SQL to instantly query GCP resources across regions, projects and organizations. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/gcp
Apache License 2.0
39 stars 24 forks source link

Fixed Error in gcp_kubernetes_node_pool table if gke autopilot is used Closes #585 #591

Closed ParthaI closed 1 month ago

ParthaI commented 1 month ago

Integration test logs

Logs ``` Add passing integration test logs here ```

Example query results

Results ``` Before fix: select * from gcp_kubernetes_node_pool Error: gcp: googleapi: Error 400: Autopilot node pools cannot be accessed or modified. Details: [ { "@type": "type.googleapis.com/google.rpc.RequestInfo", "requestId": "0xd9eb2e4dcdef82ca" } ] , badRequest (SQLSTATE HV000) +------+-----------+---------------+--------+--------------+--------------------+---------+--------------------+-------------+------------+--------+---------------------+-----------+------------+---------------------+------------------+-------+------+----------+-------> | name | self_link | location_type | status | cluster_name | initial_node_count | version | pod_ipv4_cidr_size | autoscaling | conditions | config | instance_group_urls | locations | management | max_pods_constraint | upgrade_settings | title | akas | location | projec> +------+-----------+---------------+--------+--------------+--------------------+---------+--------------------+-------------+------------+--------+---------------------+-----------+------------+---------------------+------------------+-------+------+----------+-------> +------+-----------+---------------+--------+--------------+--------------------+---------+--------------------+-------------+------------+--------+---------------------+-----------+------------+---------------------+------------------+-------+------+----------+-------> Time: 3.1s. Rows returned: 0. After fix: > select * from gcp_kubernetes_node_pool +------+-----------+---------------+--------+--------------+--------------------+---------+--------------------+-------------+------------+--------+---------------------+-----------+------------+---------------------+------------------+-------+------+----------+-------> | name | self_link | location_type | status | cluster_name | initial_node_count | version | pod_ipv4_cidr_size | autoscaling | conditions | config | instance_group_urls | locations | management | max_pods_constraint | upgrade_settings | title | akas | location | projec> +------+-----------+---------------+--------+--------------+--------------------+---------+--------------------+-------------+------------+--------+---------------------+-----------+------------+---------------------+------------------+-------+------+----------+-------> +------+-----------+---------------+--------+--------------+--------------------+---------+--------------------+-------------+------------+--------+---------------------+-----------+------------+---------------------+------------------+-------+------+----------+------- ```
misraved commented 1 month ago

Merging this PR since at the moment there is no way to list/manage the Node pools created by Clusters in auto-pilot mode.

The CLI returns the same error as well.

Autopilot clusters in Google Kubernetes Engine (GKE) manage their node pools automatically, hence for this table, we will be skipping the Clusters that have auto-pilot enabled.