-
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
Gcp cloud functions gen2 flooding #590
Gcp cloud functions gen2 flooding #590
Conversation
Signed-off-by: ashutoshreddy <ashutosh@clouddefense.ai>
…lugin-gcp into Gcp-CloudFunctions-Gen2-Flooding
Signed-off-by: ashutoshreddy <ashutosh@clouddefense.ai>
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.
@ashutoshmore658, please take a look at the review comments. Thanks!
@@ -34,6 +35,7 @@ func tableGcpCloudfunctionFunction(ctx context.Context) *plugin.Table { | |||
Name: "status", | |||
Description: "Status of the function deployment (ACTIVE, OFFLINE, CLOUD_FUNCTION_STATUS_UNSPECIFIED,DEPLOY_IN_PROGRESS, DELETE_IN_PROGRESS, UNKNOWN).", | |||
Type: proto.ColumnType_STRING, | |||
Transform: transform.From(getCloudFunctionStatus), |
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.
@ashutoshmore658, is a separate transform function necessary? Wouldn't transform.FromField("State")
suffice?
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.
No it would not suffice, I have checked it, but if you say, I will check it again.
Thank you.
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.
Hello @ashutoshmore658, I've taken another look at the changes made to this table. I can confirm that, using the default transform function transform.FromField("State")
is good for us, and there's no need to define a separate transform function for populating the column value.
Here is the result with the default transform function.
> select name, status from gcp_cloudfunctions_function
+------------------+--------+
| name | status |
+------------------+--------+
| function-1-gen-2 | ACTIVE |
| function-1-gen-1 | ACTIVE |
Is there any special case where we are not getting the status
column value with the default transform function?
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.
@ashutoshmore658, I've made some additional observations, please have a look:
- The column values for
runtime
,available_memory_mb
,build_id
,entry_point
,ingress_settings
,max_instances
,service_account_email
,timeout
,vpc_connector
, andvpc_connector_egress_settings
can be populated using the default transform function. - The
available_memory_mb
column should be of type string, rather than int. - For the columns
source_upload_url
andhttps_trigger
, a separate transform function may be necessary, as the API does not return these properties directly. - Considering we are uncertain of how users are utilizing this table in their setups, it might be prudent to refrain from modifying existing column values. Instead, adding new columns based on the API responses we receive could be more beneficial.
Please feel free to reach out if you have any questions or need further clarification.
Thank you!
@@ -34,6 +35,7 @@ func tableGcpCloudfunctionFunction(ctx context.Context) *plugin.Table { | |||
Name: "status", | |||
Description: "Status of the function deployment (ACTIVE, OFFLINE, CLOUD_FUNCTION_STATUS_UNSPECIFIED,DEPLOY_IN_PROGRESS, DELETE_IN_PROGRESS, UNKNOWN).", | |||
Type: proto.ColumnType_STRING, | |||
Transform: transform.From(getCloudFunctionStatus), |
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.
Hello @ashutoshmore658, I've taken another look at the changes made to this table. I can confirm that, using the default transform function transform.FromField("State")
is good for us, and there's no need to define a separate transform function for populating the column value.
Here is the result with the default transform function.
> select name, status from gcp_cloudfunctions_function
+------------------+--------+
| name | status |
+------------------+--------+
| function-1-gen-2 | ACTIVE |
| function-1-gen-1 | ACTIVE |
Is there any special case where we are not getting the status
column value with the default transform function?
@ParthaI sure, let me take a look at this. Thank you for the valuable feedback. |
@ParthaI actually I have tried by modifying code, checked with multiple times restarting the system(to avoid cached builds), |
Hello, @ashutoshmore658, I am not sure what the issue is with your system. I can see the result for all of the columns as mentioned here. Note: I have renamed the column I have pushed the tested code to the branch test-gcp-cloud-function-table-column. Please feel free to take a look. Thanks! |
Sure @ParthaI , I will test and lets merge it if it looks fine and okay to merge. |
Hi @ashutoshmore658, Did you get a chance to retake a look at it? |
1ab0634
into
turbot:fix-gcp-cloud-functions-missing-columns
Fixes #579 issue