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

Getting ResourceNotFound error in table azure_subnet closes #555 #556

Merged
merged 2 commits into from
Jan 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion azure/table_azure_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func getIpConfigurationAsync(ctx context.Context, ipConfig *network.IPConfigurat
rowData, err := getIpConfiguration(ctx, ipConfig, client)
if err != nil {
errorCh <- err
} else if rowData.ID != nil {
} else if rowData != nil {
ipCh <- rowData
}
}
Expand All @@ -311,6 +311,9 @@ func getIpConfiguration(ctx context.Context, ipConfig *network.IPConfiguration,

configuration, err := client.Get(ctx, resourceGroup, networkInterface, configName)
if err != nil {
if strings.Contains(err.Error(), "ResourceNotFound") {
return nil, nil
}
Comment on lines +314 to +316
Copy link
Contributor

Choose a reason for hiding this comment

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

@ParthaI Can we use the isNotFoundError function mentioned in https://github.com/turbot/steampipe-plugin-azure/blob/main/azure/errors.go#L11 to handle this error?

Copy link
Contributor

Choose a reason for hiding this comment

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

@misraved this is a separate hydrate call, not a part of the get/list config. So we have to handle exceptions in this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation @bigdatasourav 👍.

return nil, err
}

Expand Down