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

Add labels column to gcp_kms_key and gcp_compute_instance_template table. Closes #299 #301

Merged
merged 5 commits into from
Sep 14, 2021

Conversation

bigdatasourav
Copy link
Contributor

@bigdatasourav bigdatasourav commented Sep 13, 2021

Example query results

Results
> select resource_labels,tags from gcp_kubernetes_cluster
+-----------------------+-----------------------+
| resource_labels       | tags                  |
+-----------------------+-----------------------+
| {"test":"test-value"} | {"test":"test-value"} |
+-----------------------+-----------------------+

> select name,labels,tags from gcp_kms_key
+------------------------------------+-------------------------------------------------------------------------------------+--------------------------------------------------------------------------------
| name                               | labels                                                                              | tags                                                                           
+------------------------------------+-------------------------------------------------------------------------------------
| turbottest6138                     | {"name":"turbottest6138"}                                                           | {"name":"turbottest6138"}                                                      
| turbottest7719                     | {"name":"turbottest7719"}                                                           | {"name":"turbottest7719"}                                                      
| turbottest8223                     | {"name":"turbottest8223"}                                                           | {"name":"turbottest8223"}                                                      
| turbottest3642                     | {"name":"turbottest3642"}                                                           | {"name":"turbottest3642"}    

> select name,labels from gcp_compute_instance_template
+-------------------------------------+----------------------+
| name                                | labels               |
+-------------------------------------+----------------------+
| gke-cluster-1-default-pool-08d80842 | {"goog-gke-node":""} |
+-------------------------------------+----------------------+




@bigdatasourav bigdatasourav self-assigned this Sep 13, 2021
@bigdatasourav bigdatasourav changed the title Add labels column to gcp_kms_key and gcp_kubernetes_cluster table. Closes #299 Add labels column to gcp_kms_key, gcp_compute_instance_template and gcp_kubernetes_cluster table. Closes #299 Sep 13, 2021
Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments

@@ -74,6 +74,11 @@ func tableGcpKmsKey(ctx context.Context) *plugin.Table {
Hydrate: getKeyIamPolicy,
Transform: transform.FromValue(),
},
{
Name: "labels",
Description: "Labels that apply to this kms key.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bigdatasourav Where is this description from? Is it from the SDK, API, or somewhere else?

@@ -156,6 +156,12 @@ func tableGcpComputeInstanceTemplate(ctx context.Context) *plugin.Table {
Type: proto.ColumnType_JSON,
Transform: transform.FromField("Properties.Tags"),
},
{
Name: "labels",
Description: "Labels associated with the instance template.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are labels used with instance templates? From the API I can see the description:
Labels to apply to instances that are created from these properties.

So are these labels on the instance template themselves and/or labels applied to instances created from these templates?

Also, description wise, similar to the comment below, where did you get this comment from? The API has a different description (https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates).

@@ -32,7 +32,7 @@ func tableGcpKubernetesNodePool(ctx context.Context) *plugin.Table {
Type: proto.ColumnType_STRING,
},
{
Name: "selfLink",
Name: "self_link",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a different PR since it's a bug fix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix it in different PR.

@bigdatasourav bigdatasourav changed the title Add labels column to gcp_kms_key, gcp_compute_instance_template and gcp_kubernetes_cluster table. Closes #299 Add labels column to gcp_kms_key and gcp_compute_instance_template table. Closes #299 Sep 14, 2021
bigdatasourav added 2 commits September 14, 2021 20:19
@cbruno10 cbruno10 merged commit 5b25170 into main Sep 14, 2021
@cbruno10 cbruno10 deleted the issue-299 branch September 14, 2021 15:11
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.

Add labels column to gcp_kms_key and gcp_kubernetes_cluster table.
2 participants