Throw different error when route binding status is delete_failed or delete_in_progess / Treat route binding in status create_failed as non-existent #3469
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 is a fix as part of #2637. It contains changes for:
POST /v3/service_route_bindings
Two behaviours change with this PR:
1: When a service route binding is in state delete_in_progess or delete_failed, we want an error different from "Route is already bound to the service instance" to be thrown. It will now throw an error with "The binding is getting deleted or its deletion failed". 2: When a service route binding is in state create_failed, it should recreate the binding and not reject the request with "Route is already bound to the service instance".
With regard to point 1: it's important to note that the initial statement may not be entirely accurate, as there's a possibility that orphan mitigation processes may have already removed the binding in question. The Cloud Foundry Command Line Interface (CF CLI) correctly interprets the situation as a success. This is because the message conveyed to the CF CLI indicates that the task it was instructed to perform as already been completed. As a result, if the CF CLI is attempting to create a service route binding but finds that a binding already exists in a state where it's either failed deletion or is pending deletion, the CF CLI will consider this a failure.
Links to any other associated PRs
Throw an error on sb bind when in binding status is delete_failed or delete_in_progess #2657
Treat failed service-credential-binding and service-credential-key as non-existent / Do not cleanup failed bindings in apply_manifest #2636
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
bundle exec rake
I have run CF Acceptance Tests