-
Notifications
You must be signed in to change notification settings - Fork 27
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
Update tables for better use of API filters, context cancellation in list calls and page limiting for limit clause in query. Closes #336 #337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
gcp/table_gcp_compute_instance.go
Outdated
@@ -312,7 +312,11 @@ func listComputeInstances(ctx context.Context, d *plugin.QueryData, h *plugin.Hy | |||
limit := d.QueryContext.Limit | |||
if d.QueryContext.Limit != nil { | |||
if *limit < *pageSize { | |||
pageSize = limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the line no 309 plugin.Logger(ctx).Trace("listComputeInstances", "IAM I HERE")
limit := d.QueryContext.Limit | ||
if d.QueryContext.Limit != nil { | ||
if *limit < *pageSize { | ||
if *limit < 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revisit -- do we need this in GCP?
if *limit < *pageSize { | ||
if *limit < 1 { | ||
pageSize = types.Int64(1) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pageSize = types.Int64(1)
} else ```
Revisit as GCP does not have any limit issue, we have not experienced this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as per latest testing of all compliance & example queries in this branch
if len(filters) > 0 { | ||
filterString = strings.Join(filters, " ") | ||
} | ||
plugin.Logger(ctx).Trace("listComputeBackendBuckets", "filter string", filterString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugin.Logger(ctx).Trace("listComputeBackendBuckets", "filter string", filterString) |
if len(filters) > 0 { | ||
filterString = strings.Join(filters, " ") | ||
} | ||
plugin.Logger(ctx).Trace("listComputeBackendServices", "filter string", filterString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugin.Logger(ctx).Trace("listComputeBackendServices", "filter string", filterString) |
gcp/table_gcp_compute_firewall.go
Outdated
if len(filters) > 0 { | ||
filterString = strings.Join(filters, " ") | ||
} | ||
plugin.Logger(ctx).Trace("listComputeFirewalls", "filter string", filterString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugin.Logger(ctx).Trace("listComputeFirewalls", "filter string", filterString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tables
Integration test logs
integration_test.txt
Example query results
output.txt