Skip to content

Commit 53f7468

Browse files
committed
Add --strategy parem to cf bs cmd
- ensures backward compatibility
1 parent 18ef82f commit 53f7468

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

toc/rfc/rfc-draft-service-binding-rotation.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,20 @@ An application restart or restage as today will be required to activate the new
7474

7575
### CF CLI
7676

77-
Users can create multiple service credential bindings by invoking the `bind-service` command multiple times. Example:
77+
Users can create multiple service credential bindings by invoking the `bind-service` command with a `--strategy multiple` option. The default strategy `single` ensures backward compatibility of the `cf bind-service` command.
78+
79+
Example:
7880
```
79-
cf bind-service myApp myService # initial binding
80-
cf bind-service myApp myService # additional binding to the same service instance
81+
cf bind-service myApp myService # create initial binding
82+
cf bind-service myApp myService # succeeds with message "App myApp is already bound to service instance myService." No secondary binding is added.
83+
cf bind-service myApp myService --strategy single # same as previous command, 'single' is the default strategy
84+
85+
cf bind-service myApp myService --strategy multiple # adds a secondary binding to the same service instance
86+
cf bind-service myApp myService --strategy multiple # adds a third binding to the same service instance
8187
```
8288

89+
The exact parameter naming can be finalized at implementation time. A `strategy` parameter allows future extension, e.g. for OSBAPI 2.17 support mention in section "Possible Future Work".
90+
8391
`cf unbind-service myApp myService` shall delete all existing service credential bindings for `myApp` to `myService`.
8492
An additional parameter `cf unbind-service --guid <guid>` should support the deletion of a single service credential binding.
8593

@@ -89,13 +97,13 @@ The cleanup of old service credential bindings should be supported by a new CF C
8997
```
9098
cf cleanup-outdated-service-bindings myApp [--service-instance myService] [--keep-last 1]
9199
```
92-
The CLI will use the CF API `GET /v3/service_credential_bindings?app_guids=:guid ` to list the service instance bindings for an application and should delete all old bindings based on the creation date leaving the newest service bindings. With the `keep-last` parameter, users can keep the x newest bindings per app and service instance. If no service instance name is provided, the CLI should delete the old bindings of all services currently bound to the application.
100+
The CLI will use the CF API `GET /v3/service_credential_bindings?app_guids=:guid` to list the service instance bindings for an application and should delete all old bindings based on the creation date leaving the newest service bindings. With the `keep-last` parameter, users can keep the x newest bindings per app and service instance. If no service instance name is provided, the CLI should delete the old bindings of all services currently bound to the application.
93101
It is in the responsibility of the user to invoke `cf cleanup-outdated-service-bindings myApp` only after a successfully restage/restart of the app, i.e. when old service credential bindings are not used anymore by any app container.
94102

95103
A full service binding rotation flow with the CF CLI could look like:
96104
```
97-
cf bind-service myApp myService -c {<parameters>}
98-
cf bind-service myApp myService2 -c {<parameters>}
105+
cf bind-service myApp myService -c {<parameters>} --strategy multiple
106+
cf bind-service myApp myService2 -c {<parameters>} --strategy multiple
99107
cf restage myApp --strategy rolling
100108
cf cleanup-outdated-service-bindings myApp
101109
```

0 commit comments

Comments
 (0)