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

Avoid panic when ip_configuration data on firewall is null #561

Merged
merged 3 commits into from
Feb 10, 2023

Conversation

mdaguete
Copy link
Contributor

@mdaguete mdaguete commented Feb 1, 2023

When ipConfigurations data is null on azure firewall steampipe throwns an error:

   ERROR:  rpc error: code = Unknown desc = failed to populate column
'ip_configurations': rpc error: code = Internal desc = transform
ipConfigurationData failed with panic runtime error: invalid memory
address or nil pointer dereference

A json dump of the firewall resource shows:

  "ipConfigurations": null

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
Add example SQL query results here (please include the input queries as well)

When ipConfigurations data is null on azure firewall
steampipe throwns an error:

```
   ERROR:  rpc error: code = Unknown desc = failed to populate column
'ip_configurations': rpc error: code = Internal desc = transform
ipConfigurationData failed with panic runtime error: invalid memory
address or nil pointer dereference
````

A json dump of the firewall resource shows:

```
  "ipConfigurations": null
```
@misraved misraved self-requested a review February 1, 2023 16:22
@misraved
Copy link
Contributor

misraved commented Feb 1, 2023

Welcome to Steampipe @mdaguete and thanks for identifying the bug and raising this PR 👍.

The solution looks good, could you please add a comment highlighting the reason for the change?

@mdaguete
Copy link
Contributor Author

mdaguete commented Feb 3, 2023

Hi @misraved ,

The main reason is to avoid the panic error when querying a resource with unfinished configuration and break some complex queries that refers to firewall resources.

Regards.

Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

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

@mdaguete thanks once again for the fix. I have left simple feedback to add in a comment for the change 👍.

The rest of the changes look good 😄 .

azure/table_azure_firewall.go Show resolved Hide resolved
Co-authored-by: Ved misra <47312748+misraved@users.noreply.github.com>
Co-authored-by: cbruno10 <cody@turbot.com>
@misraved misraved merged commit 27686f4 into turbot:main Feb 10, 2023
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.

None yet

3 participants