Skip to content

Commit e4a8708

Browse files
Merge branch 'master' of patrickcrocker.github.com:nulldriver/cf-cli-resource
2 parents c4261af + a771b60 commit e4a8708

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ Wait for a service instance to start
660660
Enable access to a service or service plan for one or all orgs
661661

662662
- `service`: _Required._ The marketplace service name to enable
663+
- `broker`: _Optional._ Enable access to a service from a particular service broker. Required when service name is ambiguous
663664
- `access_org`: _Optional._ Enable access for a specified organization
664665
- `plan`: _Optional._ Enable access to a specified service plan
665666

@@ -669,6 +670,7 @@ Enable access to a service or service plan for one or all orgs
669670
params:
670671
command: enable-service-access
671672
service: some-service
673+
broker: some-service-broker
672674
access_org: myorg
673675
plan: simple
674676
```

itest/run-service-broker-tests

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,18 @@ it_can_enable_service_access() {
9191
local org=${1:?org null or not set}
9292
local space=${2:?space null or not set}
9393
local service=${3:?service null or not set}
94-
local plan=${4:-}
95-
local access_org=${5:-}
94+
local broker=${4:-}
95+
local plan=${5:-}
96+
local access_org=${6:-}
9697

9798
local params=$(jq -n \
9899
--arg service "$service" \
100+
--arg broker "$broker" \
99101
--arg plan "$plan" \
100102
--arg access_org "$access_org" \
101103
'{
102104
command: "enable-service-access",
105+
broker: $broker,
103106
service: $service,
104107
plan: $plan,
105108
access_org: $access_org
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
service_broker=$(get_option '.service_broker')
33
service=$(get_option '.service')
4+
broker=$(get_option '.broker')
45
plan=$(get_option '.plan')
56
access_org=$(get_option '.access_org')
67

@@ -9,4 +10,4 @@ logger::info "Executing $(logger::highlight "$command"): $service"
910
# backwards compatibility for deprecated 'service_broker' param (https://github.com/nulldriver/cf-cli-resource/issues/21)
1011
service=${service:-$service_broker}
1112

12-
cf::enable_service_access "$service" "$plan" "$access_org"
13+
cf::enable_service_access "$service" "$broker" "$plan" "$access_org"

resource/lib/cf-functions.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,12 @@ function cf::create_service_broker() {
617617

618618
function cf::enable_service_access() {
619619
local service=${1:?service null or not set}
620-
local plan=${2:-}
621-
local access_org=${3:-}
620+
local broker=${2:-}
621+
local plan=${3:-}
622+
local access_org=${4:-}
622623

623624
local args=("$service")
625+
[ -n "$broker" ] && args+=(-b "$broker")
624626
[ -n "$plan" ] && args+=(-p "$plan")
625627
[ -n "$access_org" ] && args+=(-o "$access_org")
626628

0 commit comments

Comments
 (0)