-
Notifications
You must be signed in to change notification settings - Fork 18
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] subscription_id column not displaying wrong value in azure_diagnostic_setting table. Closes #98 #99
Conversation
…ic_setting table. Closes #98
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
func getDiagnosticSettingResourceGroup(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { | ||
plugin.Logger(ctx).Trace("getDiagnosticSettingResourceGroup") | ||
|
||
var resourseGroupID string | ||
storage_account_id := h.Item.(insights.DiagnosticSettingsResource).StorageAccountID | ||
event_hub_authorization_rule_id := h.Item.(insights.DiagnosticSettingsResource).EventHubAuthorizationRuleID | ||
workspace_id := h.Item.(insights.DiagnosticSettingsResource).WorkspaceID | ||
|
||
if storage_account_id != nil { | ||
resourseGroupID = strings.Split(*storage_account_id, "/")[4] | ||
} else if event_hub_authorization_rule_id != nil { | ||
resourseGroupID = strings.Split(*event_hub_authorization_rule_id, "/")[4] | ||
} else { | ||
resourseGroupID = strings.Split(*workspace_id, "/")[4] | ||
} | ||
|
||
plugin.Logger(ctx).Trace("resourseGroupID", resourseGroupID) | ||
|
||
return resourseGroupID, nil | ||
} |
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.
why is this a hydrate function when we are not making any API call in here?
Please convert it to a 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.
@rajeshbal65 left comment on it
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
Integration test logs
Logs
Example query results
Results