cf 4.2.9.rc2 → 4.2.9.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cf/cli/service/create.rb +2 -2
- data/lib/cf/cli/service/service_instance_helper.rb +99 -0
- data/lib/cf/cli/service/services.rb +12 -32
- data/lib/cf/version.rb +1 -1
- data/lib/tasks/gem_release.rake +2 -2
- data/spec/cf/cli/app/delete_spec.rb +2 -2
- data/spec/cf/cli/app/push/create_spec.rb +1 -1
- data/spec/cf/cli/service/create_spec.rb +5 -5
- data/spec/cf/cli/service/rename_spec.rb +1 -1
- data/spec/cf/cli/service/service_instance_helper_spec.rb +155 -0
- data/spec/cf/cli/service/services_spec.rb +5 -5
- data/spec/cf/cli/space/space_spec.rb +1 -1
- data/spec/cf/cli/space/spaces_spec.rb +3 -3
- data/spec/factories/cfoundry/v2/{service_instances_factory.rb → managed_service_instances_factory.rb} +2 -2
- data/spec/factories/cfoundry/v2/user_provided_service_instances_factory.rb +12 -0
- data/spec/features/services_spec.rb +2 -3
- data/spec/integration/push_flow_spec.rb +22 -1
- data/spec/manifests/manifests_spec.rb +2 -2
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55cc0d0ff989f6e5afc8b9404527c74f0390644
|
4
|
+
data.tar.gz: 6f896df4b514a8e2827aed83b7687b670233078a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac80ed0d9c5a7eef372b9f6e25dfcae8920fff2612582331ac83726ab586dcec5269bd48e872dd4bfe686b6f9584940c88df936703063ff9e2d00ffe92f3640f
|
7
|
+
data.tar.gz: 9f040edd92bfc646f5897b418aa365fc6037ad549ad82ebd9068226bfe09cef3db7e78e87131ce4ab2cf941a64a12a6edbf1ae94be6d47459253fd48e6d3ea92
|
@@ -74,7 +74,7 @@ module CF::Service
|
|
74
74
|
|
75
75
|
service_instance.credentials = ask_credentials # input[:credentials]
|
76
76
|
else
|
77
|
-
service_instance = client.
|
77
|
+
service_instance = client.managed_service_instance
|
78
78
|
service_instance.name = input[:name, offering]
|
79
79
|
finalize
|
80
80
|
|
@@ -106,7 +106,7 @@ module CF::Service
|
|
106
106
|
|
107
107
|
def ask_credentials
|
108
108
|
credentials = {}
|
109
|
-
line("What
|
109
|
+
line("What credential parameters should applications use to connect to this service instance? (e.g. hostname, port, password)")
|
110
110
|
|
111
111
|
while keys = ask("Keys").split(/\s*,\s*/).map(&:strip)
|
112
112
|
if bad_key = keys.detect { |key| key !~ /^[-\w]+$/ }
|
@@ -0,0 +1,99 @@
|
|
1
|
+
class ServiceInstanceHelper
|
2
|
+
def self.new(instance)
|
3
|
+
"#{instance.class.name.demodulize}Helper".constantize.new(instance)
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
class UserProvidedServiceInstanceHelper
|
8
|
+
def initialize(instance)
|
9
|
+
@instance = instance
|
10
|
+
end
|
11
|
+
|
12
|
+
def service_label
|
13
|
+
"user-provided"
|
14
|
+
end
|
15
|
+
|
16
|
+
def service_provider
|
17
|
+
"n/a"
|
18
|
+
end
|
19
|
+
|
20
|
+
def version
|
21
|
+
"n/a"
|
22
|
+
end
|
23
|
+
|
24
|
+
def plan_name
|
25
|
+
"n/a"
|
26
|
+
end
|
27
|
+
|
28
|
+
def matches(opts = {})
|
29
|
+
label = opts[:service]
|
30
|
+
if label
|
31
|
+
return label == service_label
|
32
|
+
end
|
33
|
+
|
34
|
+
true
|
35
|
+
end
|
36
|
+
|
37
|
+
def name
|
38
|
+
@instance.name
|
39
|
+
end
|
40
|
+
|
41
|
+
def service_bindings
|
42
|
+
@instance.service_bindings
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class ManagedServiceInstanceHelper
|
47
|
+
def initialize(service_instance)
|
48
|
+
@instance = service_instance
|
49
|
+
end
|
50
|
+
|
51
|
+
def service_label
|
52
|
+
@instance.service_plan.service.label
|
53
|
+
end
|
54
|
+
|
55
|
+
def service_provider
|
56
|
+
@instance.service_plan.service.provider
|
57
|
+
end
|
58
|
+
|
59
|
+
def version
|
60
|
+
@instance.service_plan.service.version
|
61
|
+
end
|
62
|
+
|
63
|
+
def plan_name
|
64
|
+
@instance.service_plan.name
|
65
|
+
end
|
66
|
+
|
67
|
+
def service_bindings
|
68
|
+
@instance.service_bindings
|
69
|
+
end
|
70
|
+
|
71
|
+
def name
|
72
|
+
@instance.name
|
73
|
+
end
|
74
|
+
|
75
|
+
def matches(opts = {})
|
76
|
+
service = opts[:service]
|
77
|
+
plan = opts[:plan]
|
78
|
+
provider = opts[:provider]
|
79
|
+
version = opts[:version]
|
80
|
+
|
81
|
+
if service
|
82
|
+
return false unless File.fnmatch(service, service_label)
|
83
|
+
end
|
84
|
+
|
85
|
+
if plan
|
86
|
+
return false unless File.fnmatch(plan.upcase, plan_name.upcase)
|
87
|
+
end
|
88
|
+
|
89
|
+
if provider
|
90
|
+
return false unless File.fnmatch(provider, service_provider)
|
91
|
+
end
|
92
|
+
|
93
|
+
if version
|
94
|
+
return false unless File.fnmatch(version, self.version)
|
95
|
+
end
|
96
|
+
|
97
|
+
true
|
98
|
+
end
|
99
|
+
end
|
@@ -71,19 +71,16 @@ module CF::Service
|
|
71
71
|
def show_services_table
|
72
72
|
table(
|
73
73
|
["name", "service", "provider", "version", "plan", "bound apps"],
|
74
|
-
@services.collect { |
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
provider = service.provider
|
85
|
-
[ c(i.name, :name), label, provider, version, plan.name, apps]
|
86
|
-
end
|
74
|
+
@services.collect { |instance|
|
75
|
+
presenter = ServiceInstanceHelper.new(instance)
|
76
|
+
apps = name_list(presenter.service_bindings.collect(&:app))
|
77
|
+
|
78
|
+
label = presenter.service_label
|
79
|
+
provider = presenter.service_provider
|
80
|
+
version = presenter.version
|
81
|
+
plan_name = presenter.plan_name
|
82
|
+
|
83
|
+
[ c(presenter.name, :name), label, provider, version, plan_name, apps]
|
87
84
|
})
|
88
85
|
|
89
86
|
end
|
@@ -105,25 +102,8 @@ module CF::Service
|
|
105
102
|
return false unless File.fnmatch(name, i.name)
|
106
103
|
end
|
107
104
|
|
108
|
-
|
109
|
-
|
110
|
-
if service = options[:service]
|
111
|
-
return false unless File.fnmatch(service, plan.service.label)
|
112
|
-
end
|
113
|
-
|
114
|
-
if plan = options[:plan]
|
115
|
-
return false unless File.fnmatch(plan.upcase, plan.name.upcase)
|
116
|
-
end
|
117
|
-
|
118
|
-
if provider = options[:provider]
|
119
|
-
return false unless File.fnmatch(provider, plan.service.provider)
|
120
|
-
end
|
121
|
-
|
122
|
-
if version = options[:version]
|
123
|
-
return false unless File.fnmatch(version, plan.service.version)
|
124
|
-
end
|
125
|
-
|
126
|
-
true
|
105
|
+
helper = ServiceInstanceHelper.new(i)
|
106
|
+
return helper.matches(options)
|
127
107
|
end
|
128
108
|
end
|
129
109
|
end
|
data/lib/cf/version.rb
CHANGED
data/lib/tasks/gem_release.rake
CHANGED
@@ -10,7 +10,7 @@ namespace :gem do
|
|
10
10
|
sh! "git add lib/cf/version.rb"
|
11
11
|
|
12
12
|
print_with_purpose "Bumping to version #{gem_version}"
|
13
|
-
generate_release_notes(old_version)
|
13
|
+
#generate_release_notes(old_version)
|
14
14
|
sh!("git commit -m 'Bumping to version #{gem_version}.'")
|
15
15
|
sh!("git push")
|
16
16
|
sh!("gem release --tag")
|
@@ -20,7 +20,7 @@ namespace :gem do
|
|
20
20
|
def generate_release_notes(old_version)
|
21
21
|
print_with_purpose "Generating release notes..."
|
22
22
|
file_name = "release_#{gem_version}"
|
23
|
-
|
23
|
+
sh!("anchorman notes --name=#{file_name} --from=v#{old_version}")
|
24
24
|
sh!("git add release_notes")
|
25
25
|
end
|
26
26
|
|
@@ -52,8 +52,8 @@ module CF
|
|
52
52
|
end
|
53
53
|
|
54
54
|
context "when there are apps" do
|
55
|
-
let(:service_1) { build(:
|
56
|
-
let(:service_2) { build(:
|
55
|
+
let(:service_1) { build(:managed_service_instance, :name => "service-instance-name-1") }
|
56
|
+
let(:service_2) { build(:managed_service_instance, :name => "service-instance-name-2") }
|
57
57
|
|
58
58
|
let(:service_binding_1) { build(:service_binding, :service_instance => service_1) }
|
59
59
|
let(:service_binding_2) { build(:service_binding, :service_instance => service_2) }
|
@@ -7,7 +7,7 @@ module CF
|
|
7
7
|
let(:given) { {} }
|
8
8
|
let(:global) { {:color => false, :quiet => true} }
|
9
9
|
|
10
|
-
let(:service_instances) { Array.new(5) { build(:
|
10
|
+
let(:service_instances) { Array.new(5) { build(:managed_service_instance) } }
|
11
11
|
let(:lucid64) { build(:stack, :name => "lucid64") }
|
12
12
|
let(:client) { build(:client) }
|
13
13
|
|
@@ -73,8 +73,8 @@ module CF
|
|
73
73
|
} }
|
74
74
|
|
75
75
|
it "creates the specified service" do
|
76
|
-
CFoundry::V2::
|
77
|
-
CFoundry::V2::
|
76
|
+
CFoundry::V2::ManagedServiceInstance.any_instance.should_receive(:service_plan=).with(service_plan)
|
77
|
+
CFoundry::V2::ManagedServiceInstance.any_instance.should_receive(:create!)
|
78
78
|
capture_output { command }
|
79
79
|
end
|
80
80
|
end
|
@@ -89,8 +89,8 @@ module CF
|
|
89
89
|
let(:services) { [selected_service] }
|
90
90
|
|
91
91
|
it "uses case insensitive match" do
|
92
|
-
CFoundry::V2::
|
93
|
-
CFoundry::V2::
|
92
|
+
CFoundry::V2::ManagedServiceInstance.any_instance.should_receive(:service_plan=).with(service_plan)
|
93
|
+
CFoundry::V2::ManagedServiceInstance.any_instance.should_receive(:create!)
|
94
94
|
capture_output { command }
|
95
95
|
end
|
96
96
|
end
|
@@ -107,7 +107,7 @@ module CF
|
|
107
107
|
should_ask("What kind?", hash_including(choices: include(has_label("user-provided")))) { user_provided_service }
|
108
108
|
should_ask("Name?", anything) { "user-provided-service-name-1" }
|
109
109
|
|
110
|
-
should_print("What
|
110
|
+
should_print("What credential parameters should applications use to connect to this service instance? (e.g. hostname, port, password)")
|
111
111
|
should_ask("Keys") { "host, port, user name" }
|
112
112
|
should_print("'user name' is not a valid key")
|
113
113
|
should_ask("Keys") { "host, port" }
|
@@ -51,7 +51,7 @@ describe CF::Service::Rename do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
context "when there are services" do
|
54
|
-
let(:services) { Array.new(2) { build(:
|
54
|
+
let(:services) { Array.new(2) { build(:managed_service_instance) } }
|
55
55
|
let(:renamed_service) { services.first }
|
56
56
|
|
57
57
|
context "when the defaults are used" do
|
@@ -0,0 +1,155 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ServiceInstanceHelper do
|
4
|
+
describe ".new" do
|
5
|
+
let(:provided_instance) { build(:user_provided_service_instance) }
|
6
|
+
let(:managed_instance) { build(:managed_service_instance) }
|
7
|
+
|
8
|
+
it "returns a ManagedSerivceInstanceHelper when the argument is a ManagedServiceInstance" do
|
9
|
+
expect(ServiceInstanceHelper.new(managed_instance)).to be_a ManagedServiceInstanceHelper
|
10
|
+
end
|
11
|
+
|
12
|
+
it "returns a ManagedSerivceInstanceHelper when the argument is a ManagedServiceInstance" do
|
13
|
+
expect(ServiceInstanceHelper.new(provided_instance)).to be_a UserProvidedServiceInstanceHelper
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe UserProvidedServiceInstanceHelper do
|
19
|
+
let(:bindings) { [] }
|
20
|
+
let(:instance) { build(:user_provided_service_instance, service_bindings: bindings) }
|
21
|
+
subject(:helper) { UserProvidedServiceInstanceHelper.new(instance) }
|
22
|
+
describe "matches" do
|
23
|
+
it "returns true when 'user-provided' is the given label" do
|
24
|
+
expect(helper.matches(service: "user-provided")).to eq true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "returns false when 'user-provided' is not the given label" do
|
28
|
+
expect(helper.matches(service: "a-different-label")).to eq false
|
29
|
+
end
|
30
|
+
|
31
|
+
it "returns true when a label is not given" do
|
32
|
+
expect(helper.matches).to eq true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
its(:service_label) { should eq("user-provided") }
|
37
|
+
its(:service_provider) { should eq("n/a") }
|
38
|
+
its(:version) { should eq("n/a") }
|
39
|
+
its(:plan_name) { should eq("n/a") }
|
40
|
+
its(:name) { should eq instance.name }
|
41
|
+
its(:service_bindings) { should eq instance.service_bindings }
|
42
|
+
end
|
43
|
+
|
44
|
+
describe ManagedServiceInstanceHelper do
|
45
|
+
let(:label) { "some-label" }
|
46
|
+
let(:provider) { "some-provider" }
|
47
|
+
let(:version) { "some-version" }
|
48
|
+
let(:plan_name) { "some-plan-name" }
|
49
|
+
|
50
|
+
let(:service) { build(:service, label: label, provider: provider, version: version) }
|
51
|
+
let(:plan) { build(:service_plan, service: service, name: plan_name) }
|
52
|
+
let(:bindings) { [] }
|
53
|
+
let(:instance) { build(:managed_service_instance, service_plan: plan, service_bindings: bindings) }
|
54
|
+
subject(:helper) { ManagedServiceInstanceHelper.new(instance) }
|
55
|
+
|
56
|
+
describe "matches" do
|
57
|
+
it "returns true when no condition is specified" do
|
58
|
+
expect(helper.matches).to eq(true)
|
59
|
+
end
|
60
|
+
|
61
|
+
context "filtering based on service" do
|
62
|
+
it "returns true if the service label matches given service" do
|
63
|
+
expect(helper.matches(service: label)).to eq(true)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "returns false if the service label does not match given service" do
|
67
|
+
expect(helper.matches(service: "a-different-label")).to eq(false)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
context "filtering based on service plan" do
|
72
|
+
it "returns true if the plan name matches given plan" do
|
73
|
+
expect(helper.matches(plan: plan_name)).to eq(true)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "returns true if the plan name does not match given plan" do
|
77
|
+
expect(helper.matches(plan: "some-other-plan-name")).to eq(false)
|
78
|
+
end
|
79
|
+
|
80
|
+
it "is case insensitive" do
|
81
|
+
expect(helper.matches(plan: plan_name.upcase)).to eq(true)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context "filtering based on provider" do
|
86
|
+
it "returns true if the provider name matches given provider" do
|
87
|
+
expect(helper.matches(provider: provider)).to eq(true)
|
88
|
+
end
|
89
|
+
|
90
|
+
it "returns true if the provider does not match given provider" do
|
91
|
+
expect(helper.matches(provider: "a-different-provider")).to eq(false)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
context "filtering based on version" do
|
96
|
+
it "returns true if the version matches given version" do
|
97
|
+
expect(helper.matches(version: version)).to eq(true)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "returns true if the version does not match given version" do
|
101
|
+
expect(helper.matches(version: "a-different-version")).to eq(false)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context "multiple filters" do
|
106
|
+
it "returns true if the service instance matches all four parameters" do
|
107
|
+
expect(helper.matches(service: label, plan: plan_name,
|
108
|
+
provider: provider, version: version)).to eq true
|
109
|
+
end
|
110
|
+
|
111
|
+
it "return false if any of the parameters does not match the attribute of the service instance" do
|
112
|
+
expect(helper.matches(service: label, plan: plan_name,
|
113
|
+
provider: provider, version: "a-different-version")).to eq false
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
context "with patterns for args" do
|
118
|
+
it "returns true when service label matches the given glob" do
|
119
|
+
expect(helper.matches(service: label.gsub(/.$/, "*"))).to eq(true)
|
120
|
+
end
|
121
|
+
|
122
|
+
it "returns false when the service label doesn not match the given glob" do
|
123
|
+
expect(helper.matches(service: label + "_*")).to eq(false)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
describe "service_label" do
|
129
|
+
|
130
|
+
it "returns the label of instance's service offering" do
|
131
|
+
expect(helper.service_label).to eq label
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
describe "service_provider" do
|
136
|
+
it "returns the provider of the instance's service offering" do
|
137
|
+
expect(helper.service_provider).to eq provider
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe "version" do
|
142
|
+
it "returns the version of the instance's service offering" do
|
143
|
+
expect(helper.version).to eq version
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
describe "plan_name" do
|
148
|
+
it "returns the name of the instance's service plan" do
|
149
|
+
expect(helper.plan_name).to eq plan_name
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
its(:name) { should eq instance.name }
|
154
|
+
its(:service_bindings) { should eq instance.service_bindings }
|
155
|
+
end
|
@@ -42,7 +42,7 @@ module CF
|
|
42
42
|
|
43
43
|
let(:service_plan) { build(:service_plan, :service => build(:service, :version => "service_version", :provider => "provider")) }
|
44
44
|
let(:service_binding) { build(:service_binding, :app => app) }
|
45
|
-
let(:service1) { build(:
|
45
|
+
let(:service1) { build(:managed_service_instance, :service_plan => service_plan, :service_bindings => [service_binding]) }
|
46
46
|
|
47
47
|
let(:service_instances) { [service1] }
|
48
48
|
let(:current_space) { build(:space, :name => "the space") }
|
@@ -81,7 +81,7 @@ module CF
|
|
81
81
|
|
82
82
|
context "when one of the services does not have a service plan" do
|
83
83
|
let(:service_instances) { [service1, service2]}
|
84
|
-
let(:service2) { build(:
|
84
|
+
let(:service2) { build(:user_provided_service_instance, :service_bindings => [service_binding]) }
|
85
85
|
|
86
86
|
it 'still produces a table of service' do
|
87
87
|
subject
|
@@ -102,9 +102,9 @@ module CF
|
|
102
102
|
|
103
103
|
expect(output).to match /service-instance-.+?\s+ # name
|
104
104
|
user-provided\s+ # service
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
n\/a\s+ # provider
|
106
|
+
n\/a\s+ # version
|
107
|
+
n\/a\s+ # plan
|
108
108
|
app-name-\d+\s+ # bound apps
|
109
109
|
/x
|
110
110
|
end
|
@@ -29,7 +29,7 @@ module CF
|
|
29
29
|
|
30
30
|
let(:apps) { Array.new(2) { build(:app) } }
|
31
31
|
let(:domains) { Array.new(2) { build(:domain) } }
|
32
|
-
let(:services) { Array.new(2) { build(:
|
32
|
+
let(:services) { Array.new(2) { build(:managed_service_instance) } }
|
33
33
|
let(:space) { build(:space, :name => "some_space_name", :apps => apps, :service_instances => services, :domains => domains, :organization => organization ) }
|
34
34
|
let(:spaces) { [space] }
|
35
35
|
let(:organization) { build(:organization, :name => "Spacey Org") }
|
@@ -5,9 +5,9 @@ module CF
|
|
5
5
|
describe Spaces do
|
6
6
|
let(:full) { false }
|
7
7
|
let(:app) { build(:app) }
|
8
|
-
let!(:space_1) { build(:space, :name => "bb_second", :apps => [app], :service_instances => [build(:
|
9
|
-
let!(:space_2) { build(:space, :name => "aa_first", :apps => [app], :service_instances => [build(:
|
10
|
-
let!(:space_3) { build(:space, :name => "cc_last", :apps => [app], :service_instances => [build(:
|
8
|
+
let!(:space_1) { build(:space, :name => "bb_second", :apps => [app], :service_instances => [build(:managed_service_instance)]) }
|
9
|
+
let!(:space_2) { build(:space, :name => "aa_first", :apps => [app], :service_instances => [build(:managed_service_instance)], :domains => [build(:domain)]) }
|
10
|
+
let!(:space_3) { build(:space, :name => "cc_last", :apps => [app], :service_instances => [build(:managed_service_instance)], :domains => [build(:domain)]) }
|
11
11
|
let(:spaces) { [space_1, space_2, space_3] }
|
12
12
|
let(:organization) { build(:organization, :spaces => spaces, :name => "foo") }
|
13
13
|
let(:client) do
|
@@ -1,5 +1,5 @@
|
|
1
1
|
FactoryGirl.define do
|
2
|
-
factory :
|
2
|
+
factory :managed_service_instance, :class => CFoundry::V2::ManagedServiceInstance do
|
3
3
|
sequence(:guid) { |n| "service-instance-guid-#{n}" }
|
4
4
|
sequence(:name) { |n| "service-instance-name-#{n}" }
|
5
5
|
|
@@ -9,4 +9,4 @@ FactoryGirl.define do
|
|
9
9
|
|
10
10
|
initialize_with { new(guid, client) }
|
11
11
|
end
|
12
|
-
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :user_provided_service_instance, :class => CFoundry::V2::UserProvidedServiceInstance do
|
3
|
+
sequence(:guid) { |n| "user-provided-service-instance-guid-#{n}" }
|
4
|
+
sequence(:name) { |n| "user-provided-service-instance-name-#{n}" }
|
5
|
+
|
6
|
+
ignore do
|
7
|
+
client { FactoryGirl.build(:client) }
|
8
|
+
end
|
9
|
+
|
10
|
+
initialize_with { new(guid, client) }
|
11
|
+
end
|
12
|
+
end
|
@@ -15,7 +15,7 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
15
15
|
create_service_instance("dummy-dev", service2, plan: "small")
|
16
16
|
|
17
17
|
BlueShell::Runner.run("#{cf_bin} services") do |runner|
|
18
|
-
expect(runner).to say /#{service1}\s+user-provided\s+
|
18
|
+
expect(runner).to say /#{service1}\s+user-provided\s+n\/a\s+n\/a\s+n\/a\s+.*/
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -51,8 +51,7 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
51
51
|
expect(runner).to say "Name?"
|
52
52
|
runner.send_keys service_name
|
53
53
|
|
54
|
-
expect(runner).to say "What
|
55
|
-
Keys"
|
54
|
+
expect(runner).to say "What credential parameters should applications use to connect to this service instance? (e.g. hostname, port, password)\nKeys"
|
56
55
|
runner.send_keys "hostname"
|
57
56
|
expect(runner).to say "hostname"
|
58
57
|
runner.send_keys "myserviceinstance.com"
|
@@ -9,6 +9,7 @@ if ENV["CF_V2_RUN_INTEGRATION"]
|
|
9
9
|
let(:app) { "hello-sinatra-#{run_id}" }
|
10
10
|
let(:subdomain) { "hello-sinatra-subdomain-#{run_id}" }
|
11
11
|
let(:service_name) { "dummy-service-#{run_id}" }
|
12
|
+
let(:user_provided_name) { "user-provided-#{run_id}"}
|
12
13
|
|
13
14
|
before do
|
14
15
|
FileUtils.rm_rf File.expand_path(CF::CONFIG_DIR)
|
@@ -85,7 +86,27 @@ if ENV["CF_V2_RUN_INTEGRATION"]
|
|
85
86
|
expect(runner).not_to say "Which plan?>"
|
86
87
|
runner.send_up_arrow
|
87
88
|
expect(runner).not_to say "Which plan?>"
|
88
|
-
runner.
|
89
|
+
runner.send_keys "y"
|
90
|
+
|
91
|
+
# create a user-provided service here
|
92
|
+
expect(runner).to say "What kind?>"
|
93
|
+
runner.send_keys "user-provided"
|
94
|
+
|
95
|
+
expect(runner).to say "Name?>"
|
96
|
+
runner.send_keys user_provided_name
|
97
|
+
|
98
|
+
expect(runner).not_to say "Which plan?>"
|
99
|
+
expect(runner).to say "What credential parameters should applications use to connect to this service instance? (e.g. hostname, port, password)\nKeys>"
|
100
|
+
runner.send_keys "uri"
|
101
|
+
|
102
|
+
expect(runner).to say "uri>"
|
103
|
+
runner.send_keys "mysql://u:p@example.com:port/db"
|
104
|
+
|
105
|
+
expect(runner).to say /Creating service #{user_provided_name}.*OK/
|
106
|
+
expect(runner).to say /Binding .+ to .+ OK/
|
107
|
+
|
108
|
+
expect(runner).to say "Create another service?> n"
|
109
|
+
runner.send_keys "n"
|
89
110
|
|
90
111
|
if runner.expect "Bind other services to application?> n", 15
|
91
112
|
runner.send_return
|
@@ -65,7 +65,7 @@ describe CFManifests do
|
|
65
65
|
:service_binding,
|
66
66
|
:service_instance =>
|
67
67
|
build(
|
68
|
-
:
|
68
|
+
:managed_service_instance,
|
69
69
|
:name => "service-1",
|
70
70
|
:service_plan =>
|
71
71
|
build(
|
@@ -140,7 +140,7 @@ describe CFManifests do
|
|
140
140
|
{:services => {"service-1" => {:label => "mysql", :plan => "100"}}}
|
141
141
|
end
|
142
142
|
|
143
|
-
let(:service_1) { build(:
|
143
|
+
let(:service_1) { build(:managed_service_instance, :name => "service-1") }
|
144
144
|
let(:plan_100) { build :service_plan, :name => "100" }
|
145
145
|
|
146
146
|
let(:mysql) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.9.
|
4
|
+
version: 4.2.9.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloud Foundry Team
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - ~>
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 4.0.4.
|
48
|
+
version: 4.0.4.rc2
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 4.0.4.
|
55
|
+
version: 4.0.4.rc2
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: interact
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -335,6 +335,7 @@ files:
|
|
335
335
|
- lib/cf/cli/service/delete.rb
|
336
336
|
- lib/cf/cli/service/rename.rb
|
337
337
|
- lib/cf/cli/service/service.rb
|
338
|
+
- lib/cf/cli/service/service_instance_helper.rb
|
338
339
|
- lib/cf/cli/service/services.rb
|
339
340
|
- lib/cf/cli/service/unbind.rb
|
340
341
|
- lib/cf/cli/space/base.rb
|
@@ -486,6 +487,7 @@ files:
|
|
486
487
|
- spec/cf/cli/service/delete_spec.rb
|
487
488
|
- spec/cf/cli/service/help_spec.rb
|
488
489
|
- spec/cf/cli/service/rename_spec.rb
|
490
|
+
- spec/cf/cli/service/service_instance_helper_spec.rb
|
489
491
|
- spec/cf/cli/service/service_spec.rb
|
490
492
|
- spec/cf/cli/service/services_spec.rb
|
491
493
|
- spec/cf/cli/service/unbind_spec.rb
|
@@ -512,15 +514,16 @@ files:
|
|
512
514
|
- spec/factories/cfoundry/v2/apps_factory.rb
|
513
515
|
- spec/factories/cfoundry/v2/clients_factory.rb
|
514
516
|
- spec/factories/cfoundry/v2/domains_factory.rb
|
517
|
+
- spec/factories/cfoundry/v2/managed_service_instances_factory.rb
|
515
518
|
- spec/factories/cfoundry/v2/organizations_factory.rb
|
516
519
|
- spec/factories/cfoundry/v2/quota_definitions.rb
|
517
520
|
- spec/factories/cfoundry/v2/routes_factory.rb
|
518
521
|
- spec/factories/cfoundry/v2/service_bindings_factory.rb
|
519
|
-
- spec/factories/cfoundry/v2/service_instances_factory.rb
|
520
522
|
- spec/factories/cfoundry/v2/service_plans_factory.rb
|
521
523
|
- spec/factories/cfoundry/v2/services_factory.rb
|
522
524
|
- spec/factories/cfoundry/v2/spaces_factory.rb
|
523
525
|
- spec/factories/cfoundry/v2/stacks_factory.rb
|
526
|
+
- spec/factories/cfoundry/v2/user_provided_service_instances_factory.rb
|
524
527
|
- spec/factories/cfoundry/v2/users_factory.rb
|
525
528
|
- spec/features/account_lifecycle_spec.rb
|
526
529
|
- spec/features/create_user_spec.rb
|
@@ -666,6 +669,7 @@ test_files:
|
|
666
669
|
- spec/cf/cli/service/delete_spec.rb
|
667
670
|
- spec/cf/cli/service/help_spec.rb
|
668
671
|
- spec/cf/cli/service/rename_spec.rb
|
672
|
+
- spec/cf/cli/service/service_instance_helper_spec.rb
|
669
673
|
- spec/cf/cli/service/service_spec.rb
|
670
674
|
- spec/cf/cli/service/services_spec.rb
|
671
675
|
- spec/cf/cli/service/unbind_spec.rb
|
@@ -692,15 +696,16 @@ test_files:
|
|
692
696
|
- spec/factories/cfoundry/v2/apps_factory.rb
|
693
697
|
- spec/factories/cfoundry/v2/clients_factory.rb
|
694
698
|
- spec/factories/cfoundry/v2/domains_factory.rb
|
699
|
+
- spec/factories/cfoundry/v2/managed_service_instances_factory.rb
|
695
700
|
- spec/factories/cfoundry/v2/organizations_factory.rb
|
696
701
|
- spec/factories/cfoundry/v2/quota_definitions.rb
|
697
702
|
- spec/factories/cfoundry/v2/routes_factory.rb
|
698
703
|
- spec/factories/cfoundry/v2/service_bindings_factory.rb
|
699
|
-
- spec/factories/cfoundry/v2/service_instances_factory.rb
|
700
704
|
- spec/factories/cfoundry/v2/service_plans_factory.rb
|
701
705
|
- spec/factories/cfoundry/v2/services_factory.rb
|
702
706
|
- spec/factories/cfoundry/v2/spaces_factory.rb
|
703
707
|
- spec/factories/cfoundry/v2/stacks_factory.rb
|
708
|
+
- spec/factories/cfoundry/v2/user_provided_service_instances_factory.rb
|
704
709
|
- spec/factories/cfoundry/v2/users_factory.rb
|
705
710
|
- spec/features/account_lifecycle_spec.rb
|
706
711
|
- spec/features/create_user_spec.rb
|