cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bugfix] Idempotency when trying to share a service twice (main)

Open vchrisb opened this issue 1 year ago • 0 comments

Where this PR should be backported?

  • [x] main - all changes should by default start here
  • [ ] v8
  • [ ] v7

Description of the Change

While cf create-service has an Exitcode of 0 if a service with the name already exist, does cf share-service have an Exitcode of 1 for the similar situation. This behavior is different to cf cli v7.

cli v7:

Sharing service instance foo into org test / space dev2 as admin...
Service instance foo is already shared with that space.
OK

cli v8:

Sharing service instance foo into org test / space dev2 as admin...
A service instance called foo has already been shared with dev2.
FAILED

The PR is changing the behavior of cf8 share-service to return an exit code of 0 if the service is already shared and make it consistent with v7.

Why Is This PR Valuable?

Make cf share-service idempotent and consistent with v7

Applicable Issues

#2669

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?

vchrisb avatar May 03 '24 04:05 vchrisb