fix #234 : prevent resource creation retries if it already exists #241
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.
This change addresses the issue of retries in #234 , which was causing the users to wait for a longer time.
Now in a similar event of re-creation of resources with existing names, the user will get an appropriate error message immediately, prompting them to take corrective measure.
Key Changes:
Immediate Error on Duplicate Names: Updated
resourceInstanceCreate()
ininstances/resource_instance.go
andresourceNetworkCreate()
innetwork/resource_network.go
to perform pre-creation checks. These checks identify existing instances or networks with the same name(hostname
/label
), resulting in an immediate error message instead of retrying until timeout.Did I check other resources for similar issues?
Yes, I did check. only Instance and Network resources are being retried upon failing a successful creation.