Skip to content

Commit

Permalink
Merge pull request #206 from gossion/issue-205
Browse files Browse the repository at this point in the history
Fixes #205: use env.bosh.group instead of env.bosh.group_name
  • Loading branch information
AbelHu authored Sep 13, 2016
2 parents 2494ffe + 58fd528 commit 5637306
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/advanced/deploy-cloudfoundry-for-enterprise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ There are two types of Microsoft Azure platform events that can affect the avail
instance_type: Standard_D1
```
* Specify `bosh.group_name` in `env`
* Specify `bosh.group` in `env`
```
- name: resource_router
Expand All @@ -42,10 +42,10 @@ There are two types of Microsoft Azure platform events that can affect the avail
instance_type: Standard_D1
env:
bosh:
group_name: <availability-set-name>
group: <availability-set-name>
```
>**NOTE:** if both `availability_set` (in `cloud_properties`) and `bosh.group_name` (in `env`) are specified, it will pick value of `availability_set` as name of the availability set.
>**NOTE:** if both `availability_set` (in `cloud_properties`) and `bosh.group` (in `env`) are specified, it will pick value of `availability_set` as name of the availability set.
If `<availability-set-name>` does not exist, it will be created automatically.
Expand Down
2 changes: 1 addition & 1 deletion src/bosh_azure_cpi/lib/cloud/azure/cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def delete_stemcell(stemcell_id)
# Sample env config:
# {
# "bosh" => {
# "group_name" => "group-name"
# "group" => "group"
# }
# }
#
Expand Down
4 changes: 2 additions & 2 deletions src/bosh_azure_cpi/lib/cloud/azure/vm_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def create_availability_set(location, resource_pool, env)

availability_set_name = resource_pool.fetch('availability_set', nil)
if availability_set_name.nil?
unless env.nil? || env['bosh'].nil? || env['bosh']['group_name'].nil?
availability_set_name = env['bosh']['group_name']
unless env.nil? || env['bosh'].nil? || env['bosh']['group'].nil?
availability_set_name = env['bosh']['group']
end
end

Expand Down
10 changes: 5 additions & 5 deletions src/bosh_azure_cpi/spec/unit/vm_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,10 @@
end
end

context "with bosh.group_name specified in env" do
context "with bosh.group specified in env" do
let(:env) {
{
'bosh' => {'group_name' => 'fake-group-name'}
'bosh' => {'group' => 'fake-group'}
}
}

Expand Down Expand Up @@ -758,7 +758,7 @@
}
let(:avset_params) {
{
:name => env['bosh']['group_name'],
:name => env['bosh']['group'],
:location => "bar",
:tags => {'user-agent' => 'bosh'},
:platform_update_domain_count => 5,
Expand All @@ -768,11 +768,11 @@

before do
allow(client2).to receive(:get_availability_set_by_name).
with(env['bosh']['group_name']).
with(env['bosh']['group']).
and_return(nil)
end

it "should create availability set and use value of env.bosh.group_name as its name" do
it "should create availability set and use value of env.bosh.group as its name" do
expect(client2).to receive(:create_availability_set).
with(avset_params)

Expand Down

0 comments on commit 5637306

Please sign in to comment.