Skip to content

Commit

Permalink
[#56371214] CC stores syslog_drain_url when returned by brokers durin…
Browse files Browse the repository at this point in the history
…g bind
  • Loading branch information
David Stevenson and Nick Wade committed Sep 10, 2013
1 parent dc05516 commit 91d3e38
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GIT

GIT
remote: https://github.com/cloudfoundry/vcap-common.git
revision: cef69f1868422245c90582dbe035e6169dcf568d
revision: d42b6c8bb1d132e31335faad25f94c9286308d23
specs:
vcap_common (2.2.1)
addressable (~> 2.2)
Expand Down Expand Up @@ -162,10 +162,10 @@ GEM
machinist (1.0.6)
membrane (0.0.2)
method_source (0.8.2)
mime-types (1.24)
mime-types (1.25)
mini_portile (0.5.1)
msgpack (0.5.5)
multi_json (1.7.9)
multi_json (1.8.0)
multi_xml (0.5.5)
multipart-post (1.2.0)
mysql2 (0.3.13)
Expand Down Expand Up @@ -236,7 +236,7 @@ GEM
sqlite3 (1.3.8)
squash_ruby (1.2.0)
json
steno (1.1.0)
steno (1.2.2)
fluent-logger
grape
yajl-ruby (~> 1.0)
Expand Down
1 change: 1 addition & 0 deletions app/models/services/managed_service_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def bind_on_gateway(service_binding)
service_binding.gateway_name = gw_attrs.service_id
service_binding.gateway_data = gw_attrs.configuration
service_binding.credentials = gw_attrs.credentials
service_binding.syslog_drain_url = gw_attrs.syslog_drain_url
end

def bindable?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Sequel.migration do
change do
alter_table :service_bindings do
add_column :syslog_drain_url, String
end
end
end
18 changes: 18 additions & 0 deletions spec/controllers/services/service_bindings_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,23 @@ module VCAP::CloudController
ServiceBinding.last.binding_options.should == binding_options
end
end

describe "creating a binding for a service that does syslog drains" do
let(:space) { Space.make }
let(:developer) { make_developer_for_space(space) }

it "stores the syslog_drain_url" do
instance = ManagedServiceInstance.make(:space => space)
app = App.make(:space => space)

post("/v2/service_bindings",
{"app_guid" => app.guid,
"service_instance_guid" => instance.guid}.to_json,
headers_for(developer))

last_response.status.should == 201
ServiceBinding.last.syslog_drain_url.should == "syslog://example.com:1234"
end
end
end
end
1 change: 1 addition & 0 deletions spec/support/fakes/service_gateway_client_fake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def bind(*)
:service_id => SecureRandom.uuid,
:configuration => "CONFIGURATION",
:credentials => {"password" => "PASSWORD"},
:syslog_drain_url => "syslog://example.com:1234",
}.to_json)
end
end
Expand Down

0 comments on commit 91d3e38

Please sign in to comment.