cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 929 forks source link

Create user-provided-service is not idempotent when name is already taken #3248

Closed sethboyles closed 2 weeks ago

sethboyles commented 1 month ago

Please fill out the issue checklist below and provide ALL the requested information.

Describe the bug and the command you saw an issue with Trying to create a user-provided-service that already exists fails with exit code 1 instead of succeeding (like most other commands, such as create-space and create-user). I seems like there have been previous efforts to make CF commands idempotent: https://github.com/cloudfoundry/cli/pull/2264

What happened

$ cf create-user-provided-service myservice
Creating user provided service myservice in org org-1 / space org-1-space-1 as admin...
The service instance name is taken: myservice.
FAILED
# exit code 1

Expected behavior

$ cf create-user-provided-service myservice
Creating user provided service myservice  in org org-1 / space org-1-space-1 as admin...
The service instance already exists: myservice.
OK
# exit code 0

Exact Steps To Reproduce Steps to reproduce the behavior; include the exact CLI commands and verbose output:

  1. Run cf create-user-provided-service myservice
  2. Run cf create-user-provided-service myservice again
gururajsh commented 2 weeks ago

Fix for this is in and will be available in the next release.