Peripli / service-manager-cli

CLI Tools for Service Manager
Apache License 2.0
22 stars 16 forks source link

Unable to delete binding when instance name isn't unique #165

Closed gadisn closed 1 year ago

gadisn commented 2 years ago

Issue Template

Step 1: Is this issue for here?

The issue is indeed for the cli.

Step 2: Describe the problem (very short text description):

Trying to delete binding fails if it belongs to an instance with a non-unique name (i.e. there are additional instances with the same name)

Step 3: Describe the problem (steps):

Steps to reproduce:

  1. Create an instance with name 'abc' and binding
  2. Create a second instance with the same name
  3. Use the cli 'unbind' to delete the first binding

Observed Results:

Error message that the deletion failed since the instance name isn't unique: Error: more than one service instance with name logging-bnr-standard found. Use --id flag to specify id of the binding to be deleted

Expected Results:

Being able to delete the binding

Relevant Code Snippet:

For unbind I can't supply an id for the instance. Only the name is used. I believe the problem is in https://github.com/Peripli/service-manager-cli/blob/master/internal/cmd/binding/unbind.go#L90

gadisn commented 1 year ago

Closing. It turns out that I can unbind with the binding id: smctl unbind --id='...'. The difficulty was that the binding id isn't listed in the cockpit. However, it can be found using list-bindings.