[Bugfix] [v8] Idempotency when trying to create a service twice #2264
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.
Thank you for contributing to the CF CLI! Please read the following:
If your contribution falls under a company CLA but your membership is not public, expect delays while we confirm.
Does this PR modify CLI v6, CLI v7, or CLI v8?
It modifies CLI V8
Description of the Change
For the cf cs command, before V8 it was able to work in a idempotent way. The expected behavior was to be able to fulfill with an OK status the command even if the service name was already taken. Now, V8 fails in this scenario.
By looking into the code, this pattern was implemented but left the error handler when CAPI V3 answered with a 422 status code with the message
"the service instance name is taken".
Adding the message into the error handling function and everything works as expected.
Why Is This PR Valuable?
Enabling an expected behavior to the create-service command.
Why Should This Be In Core?
Bugifx.
Applicable Issues
How Urgent Is The Change?
Is the change urgent? If so, explain why it is time-sensitive.
Other Relevant Parties
Who else is affected by the change?