bosh-bootstrap 0.14.2 → 0.14.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +2 -0
- data/lib/bosh-bootstrap/cli/commands/deploy.rb +1 -0
- data/lib/bosh-bootstrap/microbosh_providers/base.rb +1 -1
- data/lib/bosh-bootstrap/microbosh_providers/openstack.rb +20 -0
- data/lib/bosh-bootstrap/version.rb +1 -1
- data/spec/unit/microbosh_providers/openstack_spec.rb +25 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 107abb3ad26122e0fa2fb1e8b2eab29b753ab9e5
|
4
|
+
data.tar.gz: 25d5e7ef383295c216ba761477fdbab6d58a934d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6909070081d3a519a4b270f8b637d8c03e5e42f6088836b1d6ba5bf9de0303b3a5fe1f4b4d593ebf3df6dc4fd66abcfa700445bf129021edd5995459cab0e7bb
|
7
|
+
data.tar.gz: 4fffaadec6c276db11f36501f46832002418a478ea51ddb56e4bedb9e5675b2a51b5780d59babd7df76867ef59331ddebcb74423e0bc42343ee7894829e6cfe5
|
data/ChangeLog.md
CHANGED
@@ -9,12 +9,14 @@ bosh-bootstrap deploy
|
|
9
9
|
```
|
10
10
|
|
11
11
|
v0.14
|
12
|
+
-----
|
12
13
|
|
13
14
|
- default target directory is current director, rather than `~/.microbosh`
|
14
15
|
- fixed to use new stemcells
|
15
16
|
- [aws] VPC support - detects if VPCs available and allows selection, then select of subset, then creates security groups into the VPC
|
16
17
|
- [aws vpc] network type: manual for vpc
|
17
18
|
- [aws] reuse existing bosh stemcell AMIs - automatically detects if a stemcell has been uploaded/converted into an AMI [v0.14.2]
|
19
|
+
- [openstack] reuse existing bosh stemcell images - automatically detects if a stemcell has been uploaded/converted into an OpenStack image [v0.14.3]
|
18
20
|
|
19
21
|
v0.13
|
20
22
|
-----
|
@@ -131,6 +131,26 @@ module Bosh::Bootstrap::MicroboshProviders
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
+
def owned_images
|
135
|
+
fog_compute.images
|
136
|
+
end
|
137
|
+
|
138
|
+
# @return [String] Any AMI imageID
|
139
|
+
# e.g. "BOSH-14c85f35-3dd3-4200-af85-ada65216b2de" for given BOSH stemcell name/version
|
140
|
+
# Usage: find_ami_for_stemcell("bosh-openstack-kvm-ubuntu-trusty-go_agent", "2732")
|
141
|
+
def find_image_for_stemcell(name, version)
|
142
|
+
image = owned_images.find do |image|
|
143
|
+
metadata = image.metadata
|
144
|
+
metadata_name = metadata.find { |m| m.key == "name" }
|
145
|
+
metadata_version = metadata.find { |m| m.key == "version" }
|
146
|
+
metadata_name && metadata_version && metadata_name.value == name && metadata_version.value == version
|
147
|
+
end
|
148
|
+
image.name if image
|
149
|
+
end
|
150
|
+
|
151
|
+
def discover_if_stemcell_image_already_uploaded
|
152
|
+
find_image_for_stemcell(latest_stemcell.stemcell_name, latest_stemcell.version)
|
153
|
+
end
|
134
154
|
end
|
135
155
|
end
|
136
156
|
Bosh::Bootstrap::MicroboshProviders.register_provider("openstack", Bosh::Bootstrap::MicroboshProviders::OpenStack)
|
@@ -95,4 +95,29 @@ describe Bosh::Bootstrap::MicroboshProviders::OpenStack do
|
|
95
95
|
yaml_files_match(microbosh_yml, spec_asset("microbosh_yml/micro_bosh.openstack.boot_from_volume.yml"))
|
96
96
|
end
|
97
97
|
end
|
98
|
+
|
99
|
+
describe "existing stemcells as openstack images" do
|
100
|
+
|
101
|
+
it "finds match" do
|
102
|
+
subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
|
103
|
+
expect(subject).to receive(:owned_images).and_return([
|
104
|
+
instance_double("Fog::Compute::OpenStack::Image",
|
105
|
+
name: "BOSH-14c85f35-3dd3-4200-af85-ada65216b2de",
|
106
|
+
metadata: [
|
107
|
+
instance_double("Fog::Compute::OpenStack::Metadata",
|
108
|
+
key: "name", value: "bosh-openstack-kvm-ubuntu-trusty-go_agent"),
|
109
|
+
instance_double("Fog::Compute::OpenStack::Metadata",
|
110
|
+
key: "version", value: "2732"),
|
111
|
+
])
|
112
|
+
])
|
113
|
+
expect(subject.find_image_for_stemcell("bosh-openstack-kvm-ubuntu-trusty-go_agent", "2732")).to eq("BOSH-14c85f35-3dd3-4200-af85-ada65216b2de")
|
114
|
+
end
|
115
|
+
|
116
|
+
it "doesn't find match" do
|
117
|
+
subject = Bosh::Bootstrap::MicroboshProviders::OpenStack.new(microbosh_yml, settings, fog_compute)
|
118
|
+
expect(subject).to receive(:owned_images).and_return([])
|
119
|
+
expect(subject.find_image_for_stemcell("xxxx", "12345")).to be_nil
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
98
123
|
end
|