Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2 from hgadgil/master

Send provider in gateway provision request (with bump to vcap-common)
  • Loading branch information...
commit fc28aa8973b3e46b6e90ee243e3ae95baae1a4d2 2 parents 0cabfa7 + 9a0caba
@kushmerick kushmerick authored
View
2  Gemfile
@@ -12,7 +12,7 @@ gem "sinatra-contrib"
gem "yajl-ruby"
gem 'vcap-concurrency', :git => 'git://github.com/cloudfoundry/vcap-concurrency.git'
gem "membrane", "~> 0.0.2"
-gem "vcap_common", "~> 2.0.8", :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => '055964f622'
+gem "vcap_common", "~> 2.0.8", :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => '9267b079b1'
gem "cf-uaa-lib", "~> 1.3.0"
gem "httpclient"
gem "steno", "~> 1.0.0"
View
4 Gemfile.lock
@@ -1,7 +1,7 @@
GIT
remote: git://github.com/cloudfoundry/vcap-common.git
- revision: 055964f62282c94ebe7c3ce6f4df9fb093a17714
- ref: 055964f622
+ revision: 9267b079b1179360dc0356c5dbd0ff9b772f663d
+ ref: 9267b079b1
specs:
vcap_common (2.0.10)
em-http-request (~> 1.0.0.beta3, < 1.0.0.beta4)
View
5 lib/cloud_controller/models/service_instance.rb
@@ -175,9 +175,8 @@ def provision_on_gateway
:plan => service_plan.name,
:plan_option => {}, # TODO: remove this
:version => service_plan.service.version,
- # The current version of the service gateways that are in cf-release don't
- # support this. It makes them fail json validation of the message.
- # :user_guid => VCAP::CloudController::SecurityContext.current_user_guid
+ :provider => service_plan.service.provider,
+ :user_guid => VCAP::CloudController::SecurityContext.current_user_guid
)
logger.debug "provision response for instance #{guid} #{gw_attrs.inspect}"
View
30 spec/models/service_instance_spec.rb
@@ -37,9 +37,13 @@ module VCAP::CloudController
let(:gw_client) { double(:client) }
let(:token) { Models::ServiceAuthToken.make }
+
let(:service) { Models::Service.make(:label => token.label,
- :provider => token.provider) }
- let(:service_plan) { Models::ServicePlan.make(:service => service) }
+ :provider => token.provider,
+ :version => "1.0") }
+
+ let(:service_plan) { Models::ServicePlan.make(:service => service,
+ :name => "myplan") }
let(:provision_resp) do
VCAP::Services::Api::GatewayHandleResponse.new(
@@ -90,6 +94,28 @@ module VCAP::CloudController
end
}.should raise_error
end
+
+ it "ensure gateway provision request contains specific fields" do
+ VCAP::CloudController::SecurityContext.
+ should_receive(:current_user_email).
+ and_return("a@b.c")
+
+ min_expected_fields_in_gw_provision_request = {
+ :label => "#{token.label}-#{service.version}",
+ :name => "foobar",
+ :email => "a@b.c",
+ :plan => "myplan",
+ :version => "1.0",
+ :user_guid => nil,
+ :provider => token.provider,
+ }
+
+ gw_client.should_receive(:provision).
+ with(hash_including(min_expected_fields_in_gw_provision_request)).
+ and_return(provision_resp)
+
+ instance = Models::ServiceInstance.make(:name => "foobar", :service_plan => service_plan)
+ end
end
context "service deprovisioning" do
Please sign in to comment.
Something went wrong with that request. Please try again.