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

existing Data Sources now return errors on 404s #15799

Conversation

modular-magician
Copy link
Collaborator

Fixes #12873

This does not guarantee all data sources will return errors if empty -- there are some for which this is intended functionality such as data sources filtering for what data they would have displayed, or if an endpoint is successfully reached due to actually existing but simply containing no information for the data source to display, as their lack of data is intentional.

Local testing entailed doing trial runs of data sources that had more unusual configurations (e.g. 1), and verifying functionality for a few different resources that the more universal configurations (e.g. 1 and 2) that involved either replacing references to transport_tpg.HandleNotFoundError with transport_tpg.HandleDataSourceNotFoundError or wrapping standard resource read functions with a check for an empty ID, as this would be returned by these resource reads using transport_tpg.HandleNotFoundError.

Should not result in false-positives as the two main functionality changes due the following:

If using the transport_tpg.HandleDataSourceNotFoundError return an error on 404 directly, maintains logic for returning non 404 errors

If using the d.Id == "" check, the d.SetId("") would be passed up via the transport_tpg.HandleNotFoundError function, in which case this is the Error we directly are intending to add (the example functionality previously added via Container Cluster per parent issue)

Release Note Template for Downstream PRs (will be copied)


Derived from GoogleCloudPlatform/magic-modules#8858

@modular-magician modular-magician merged commit b19741c into hashicorp:FEATURE-BRANCH-major-release-5.0.0 Sep 11, 2023
3 checks passed
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant