🐛 Change data conversion to allow for nil resources. Fix azure monitor as an example #2321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the resources we try to fetch may not be present, consider this as an example:
When computing the storage account it is totally possible that this resource is not present. Until now, trying to return a nil resource resulted in a panic which was fixed by returning an error, something like
which led to
The problem with this is that there's not really an error, it's just that the storage account isn't present.
To fix this, I saw that we have a
plugin.NotReady
error which seemed like a good indicator of this use case. This now results inwhich will allow for better assertions
Chaining on null resources remains functional: