vagrant-google 2.4.0.rc0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,26 +30,30 @@ describe VagrantPlugins::Google::Config do
30
30
  end
31
31
  end
32
32
 
33
- its("name") { should match "i-[0-9]{10}-[0-9a-f]{4}" }
34
- its("image") { should be_nil }
35
- its("image_family") { should be_nil }
36
- its("image_project_id") { should be_nil }
37
- its("instance_group") { should be_nil }
38
- its("zone") { should == "us-central1-f" }
39
- its("network") { should == "default" }
40
- its("machine_type") { should == "n1-standard-1" }
41
- its("disk_size") { should == 10 }
42
- its("disk_name") { should be_nil }
43
- its("disk_type") { should == "pd-standard" }
44
- its("instance_ready_timeout") { should == 20 }
45
- its("metadata") { should == {} }
46
- its("tags") { should == [] }
47
- its("labels") { should == {} }
48
- its("scopes") { should == nil }
49
- its("additional_disks") { should == [] }
50
- its("preemptible") { should be_falsey }
51
- its("auto_restart") { should }
52
- its("on_host_maintenance") { should == "MIGRATE" }
33
+ its("name") { should match "i-[0-9]{10}-[0-9a-f]{4}" }
34
+ its("image") { should be_nil }
35
+ its("image_family") { should be_nil }
36
+ its("image_project_id") { should be_nil }
37
+ its("instance_group") { should be_nil }
38
+ its("zone") { should == "us-central1-f" }
39
+ its("network") { should == "default" }
40
+ its("machine_type") { should == "n1-standard-1" }
41
+ its("disk_size") { should == 10 }
42
+ its("disk_name") { should be_nil }
43
+ its("disk_type") { should == "pd-standard" }
44
+ its("instance_ready_timeout") { should == 20 }
45
+ its("metadata") { should == {} }
46
+ its("tags") { should == [] }
47
+ its("labels") { should == {} }
48
+ its("scopes") { should == nil }
49
+ its("additional_disks") { should == [] }
50
+ its("preemptible") { should be_falsey }
51
+ its("auto_restart") { should }
52
+ its("on_host_maintenance") { should == "MIGRATE" }
53
+ its("accelerators") { should == [] }
54
+ its("enable_secure_boot") { should be_falsey }
55
+ its("enable_vtpm") { should be_falsey }
56
+ its("enable_integrity_monitoring") { should be_falsey }
53
57
  end
54
58
 
55
59
  describe "overriding defaults" do
@@ -57,8 +61,28 @@ describe VagrantPlugins::Google::Config do
57
61
  # simple boilerplate test, so I cut corners here. It just sets
58
62
  # each of these attributes to "foo" in isolation, and reads the value
59
63
  # and asserts the proper result comes back out.
60
- [:name, :image, :image_family, :image_project_id, :zone, :instance_ready_timeout, :machine_type, :disk_size, :disk_name, :disk_type,
61
- :network, :network_project_id, :metadata, :labels, :can_ip_forward, :external_ip, :autodelete_disk].each do |attribute|
64
+ [
65
+ :name,
66
+ :image,
67
+ :image_family,
68
+ :image_project_id,
69
+ :zone,
70
+ :instance_ready_timeout,
71
+ :machine_type,
72
+ :disk_size,
73
+ :disk_name,
74
+ :disk_type,
75
+ :network,
76
+ :network_project_id,
77
+ :metadata,
78
+ :labels,
79
+ :can_ip_forward,
80
+ :external_ip,
81
+ :autodelete_disk,
82
+ :enable_secure_boot,
83
+ :enable_vtpm,
84
+ :enable_integrity_monitoring,
85
+ ].each do |attribute|
62
86
 
63
87
  it "should not default #{attribute} if overridden" do
64
88
  instance.send("#{attribute}=".to_sym, "foo")
@@ -89,6 +113,14 @@ describe VagrantPlugins::Google::Config do
89
113
  errors = instance.validate("foo")["Google Provider"]
90
114
  expect(errors).to include(/on_host_maintenance_invalid_on_preemptible/)
91
115
  end
116
+
117
+ it "should raise error with accelerators and on_host_maintenance is not TERMINATE" do
118
+ instance.accelerators = [{ :type => "nvidia-tesla-k80" }]
119
+ instance.on_host_maintenance = "MIGRATE"
120
+ instance.finalize!
121
+ errors = instance.validate("foo")["Google Provider"]
122
+ expect(errors).to include(/on_host_maintenance_invalid_with_accelerators/)
123
+ end
92
124
  end
93
125
 
94
126
  describe "getting credentials from environment" do
@@ -99,13 +131,11 @@ describe VagrantPlugins::Google::Config do
99
131
  end
100
132
  end
101
133
 
102
- its("google_client_email") { should be_nil }
103
134
  its("google_json_key_location") { should be_nil }
104
135
  end
105
136
 
106
137
  context "with Google credential environment variables" do
107
138
  before :each do
108
- allow(ENV).to receive(:[]).with("GOOGLE_CLIENT_EMAIL").and_return("client_id_email")
109
139
  allow(ENV).to receive(:[]).with("GOOGLE_JSON_KEY_LOCATION").and_return("/path/to/json/key")
110
140
  end
111
141
 
@@ -115,7 +145,6 @@ describe VagrantPlugins::Google::Config do
115
145
  end
116
146
  end
117
147
 
118
- its("google_client_email") { should == "client_id_email" }
119
148
  its("google_json_key_location") { should == "/path/to/json/key" }
120
149
  end
121
150
  end
@@ -131,6 +160,7 @@ describe VagrantPlugins::Google::Config do
131
160
  let(:config_network) { "foo" }
132
161
  let(:can_ip_forward) { true }
133
162
  let(:external_ip) { "foo" }
163
+ let(:accelerators) { [{ :type => "foo" }] }
134
164
 
135
165
  def set_test_values(instance)
136
166
  instance.name = config_name
@@ -143,6 +173,7 @@ describe VagrantPlugins::Google::Config do
143
173
  instance.zone = config_zone
144
174
  instance.can_ip_forward = can_ip_forward
145
175
  instance.external_ip = external_ip
176
+ instance.accelerators = accelerators
146
177
  end
147
178
 
148
179
  it "should raise an exception if not finalized" do
@@ -172,6 +203,7 @@ describe VagrantPlugins::Google::Config do
172
203
  its("zone") { should == config_zone }
173
204
  its("can_ip_forward") { should == can_ip_forward }
174
205
  its("external_ip") { should == external_ip }
206
+ its("accelerators") { should == accelerators }
175
207
  end
176
208
 
177
209
  context "with a specific config set" do
@@ -200,6 +232,7 @@ describe VagrantPlugins::Google::Config do
200
232
  its("zone") { should == zone_name }
201
233
  its("can_ip_forward") { should == can_ip_forward }
202
234
  its("external_ip") { should == external_ip }
235
+ its("accelerators") { should == accelerators }
203
236
  end
204
237
 
205
238
  describe "inheritance of parent config" do
@@ -234,47 +267,76 @@ describe VagrantPlugins::Google::Config do
234
267
  end
235
268
 
236
269
  describe "merging" do
237
- let(:first) { described_class.new }
238
- let(:second) { described_class.new }
270
+ let(:current) { described_class.new }
271
+ let(:other) { described_class.new }
272
+
273
+ subject { current.merge(other) }
239
274
 
240
275
  it "should merge the metadata" do
241
- first.metadata["one"] = "foo"
242
- second.metadata["two"] = "bar"
276
+ current.metadata["one"] = "foo"
277
+ other.metadata["two"] = "bar"
243
278
 
244
- third = first.merge(second)
245
- expect(third.metadata).to eq({
279
+ expect(subject.metadata).to eq({
246
280
  "one" => "foo",
247
281
  "two" => "bar"
248
282
  })
249
283
  end
250
284
 
285
+ it "should merge the metadata and overwrite older values" do
286
+ current.metadata = {
287
+ "one" => "foo",
288
+ "name" => "current",
289
+ }
290
+
291
+ other.metadata = {
292
+ "two" => "bar",
293
+ "name" => "other",
294
+ }
295
+
296
+ expect(subject.metadata).to eq({
297
+ "one" => "foo",
298
+ "two" => "bar",
299
+ "name" => "other",
300
+ })
301
+ end
302
+
251
303
  it "should merge the labels" do
252
- first.labels["one"] = "one"
253
- second.labels["two"] = "two"
304
+ current.labels["one"] = "one"
305
+ other.labels["two"] = "two"
254
306
 
255
- third = first.merge(second)
256
- expect(third.labels).to eq({
307
+ expect(subject.labels).to eq({
257
308
  "one" => "one",
258
309
  "two" => "two"
259
310
  })
260
311
  end
312
+
313
+ it "should merge the labels and overwrite older values" do
314
+ current.labels["one"] = "one"
315
+ current.labels["name"] = "current"
316
+ other.labels["two"] = "two"
317
+ other.labels["name"] = "other"
318
+
319
+ expect(subject.labels).to eq({
320
+ "one" => "one",
321
+ "two" => "two",
322
+ "name" => "other",
323
+ })
324
+ end
261
325
 
262
326
  it "should merge the tags" do
263
- first.tags = ["foo", "bar"]
264
- second.tags = ["biz"]
327
+ current.tags = ["foo", "bar"]
328
+ other.tags = ["biz"]
265
329
 
266
- third = first.merge(second)
267
- expect(third.tags).to include("foo")
268
- expect(third.tags).to include("bar")
269
- expect(third.tags).to include("biz")
330
+ expect(subject.tags).to include("foo")
331
+ expect(subject.tags).to include("bar")
332
+ expect(subject.tags).to include("biz")
270
333
  end
271
334
 
272
335
  it "should merge the additional_disks" do
273
- first.additional_disks = [{:one => "one"}]
274
- second.additional_disks = [{:two => "two"}]
336
+ current.additional_disks = [{:one => "one"}]
337
+ other.additional_disks = [{:two => "two"}]
275
338
 
276
- third = first.merge(second)
277
- expect(third.additional_disks).to contain_exactly(
339
+ expect(subject.additional_disks).to contain_exactly(
278
340
  {:one => "one"}, {:two => "two"}
279
341
  )
280
342
  end
@@ -297,7 +359,6 @@ describe VagrantPlugins::Google::Config do
297
359
 
298
360
  before :each do
299
361
  # Stub out required env to make sure we produce only errors we're looking for.
300
- allow(ENV).to receive(:[]).with("GOOGLE_CLIENT_EMAIL").and_return("client_id_email")
301
362
  allow(ENV).to receive(:[]).with("GOOGLE_PROJECT_ID").and_return("my-awesome-project")
302
363
  allow(ENV).to receive(:[]).with("GOOGLE_JSON_KEY_LOCATION").and_return("/path/to/json/key")
303
364
  allow(ENV).to receive(:[]).with("GOOGLE_SSH_KEY_LOCATION").and_return("/path/to/ssh/key")
@@ -28,16 +28,17 @@ Gem::Specification.new do |s|
28
28
  s.required_rubygems_version = ">= 1.3.6"
29
29
  s.rubyforge_project = "vagrant-google"
30
30
 
31
- s.add_runtime_dependency "fog-google", "~> 1.9.1"
31
+ s.add_runtime_dependency "fog-google", "~> 1.17.0"
32
32
 
33
33
  # This is a restriction to avoid errors on `failure_message_for_should`
34
34
  # TODO: revise after vagrant_spec goes past >0.0.1 (at master@e623a56)
35
35
  s.add_development_dependency "rspec-legacy_formatters"
36
36
 
37
- s.add_development_dependency "rake", "~> 12.3"
38
- s.add_development_dependency "rspec", ">= 3.5.0", "<= 3.6"
37
+ s.add_development_dependency "rake", ">= 13.0.1"
38
+ s.add_development_dependency "rspec", ">= 3.10", "< 4.0"
39
39
  s.add_development_dependency "rspec-its", "~> 1.2"
40
- s.add_development_dependency "rubocop", "~> 0.50"
40
+ s.add_development_dependency "rubocop", "~> 0.83"
41
+ s.add_development_dependency "rubocop-performance", "~> 1.5.2"
41
42
  s.add_development_dependency "highline"
42
43
  s.add_development_dependency "pry"
43
44
  s.add_development_dependency "pry-byebug"
@@ -24,7 +24,6 @@
24
24
 
25
25
  # Customize these global variables
26
26
  $GOOGLE_PROJECT_ID = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
27
- $GOOGLE_CLIENT_EMAIL = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
28
27
  $GOOGLE_JSON_KEY_LOCATION = "/path/to/your/private-key.json"
29
28
  $LOCAL_USER = "mitchellh"
30
29
  $LOCAL_SSH_KEY = "~/.ssh/id_rsa"
@@ -54,7 +53,6 @@ Vagrant.configure("2") do |config|
54
53
  config.vm.define :z1c do |z1c|
55
54
  z1c.vm.provider :google do |google, override|
56
55
  google.google_project_id = $GOOGLE_PROJECT_ID
57
- google.google_client_email = $GOOGLE_CLIENT_EMAIL
58
56
  google.google_json_key_location = $GOOGLE_JSON_KEY_LOCATION
59
57
  google.zone = "us-central1-c"
60
58
 
@@ -74,7 +72,6 @@ Vagrant.configure("2") do |config|
74
72
  config.vm.define :z1f do |z1f|
75
73
  z1f.vm.provider :google do |google, override|
76
74
  google.google_project_id = $GOOGLE_PROJECT_ID
77
- google.google_client_email = $GOOGLE_CLIENT_EMAIL
78
75
  google.google_json_key_location = $GOOGLE_JSON_KEY_LOCATION
79
76
  google.zone = "us-central1-f"
80
77
 
@@ -20,7 +20,6 @@
20
20
 
21
21
  # Customize these global variables
22
22
  $GOOGLE_PROJECT_ID = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
23
- $GOOGLE_CLIENT_EMAIL = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
24
23
  $GOOGLE_JSON_KEY_LOCATION = "/path/to/your/private-key.json"
25
24
  $LOCAL_USER = "mitchellh"
26
25
  $LOCAL_SSH_KEY = "~/.ssh/id_rsa"
@@ -31,7 +30,6 @@ Vagrant.configure("2") do |config|
31
30
 
32
31
  config.vm.provider :google do |google, override|
33
32
  google.google_project_id = $GOOGLE_PROJECT_ID
34
- google.google_client_email = $GOOGLE_CLIENT_EMAIL
35
33
  google.google_json_key_location = $GOOGLE_JSON_KEY_LOCATION
36
34
 
37
35
  # Override provider defaults
@@ -19,7 +19,6 @@ Vagrant.configure("2") do |config|
19
19
 
20
20
  config.vm.provider :google do |google, override|
21
21
  google.google_project_id = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
22
- google.google_client_email = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
23
22
  google.google_json_key_location = "/path/to/your/private-key.json"
24
23
 
25
24
  google.image_family = 'ubuntu-1604-lts'
@@ -19,7 +19,6 @@ Vagrant.configure("2") do |config|
19
19
 
20
20
  config.vm.provider :google do |google, override|
21
21
  google.google_project_id = "YOUR_GOOGLE_CLOUD_PROJECT_ID"
22
- google.google_client_email = "YOUR_SERVICE_ACCOUNT_EMAIL_ADDRESS"
23
22
  google.google_json_key_location = "/path/to/your/private-key.json"
24
23
 
25
24
  override.ssh.username = "mitchellh"
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0.rc0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Johnson
8
8
  - Artem Yakimenko
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-04-23 00:00:00.000000000 Z
12
+ date: 2021-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog-google
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.9.1
20
+ version: 1.17.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 1.9.1
27
+ version: 1.17.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec-legacy_formatters
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -43,36 +43,36 @@ dependencies:
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '12.3'
48
+ version: 13.0.1
49
49
  type: :development
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: '12.3'
55
+ version: 13.0.1
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 3.5.0
63
- - - "<="
62
+ version: '3.10'
63
+ - - "<"
64
64
  - !ruby/object:Gem::Version
65
- version: '3.6'
65
+ version: '4.0'
66
66
  type: :development
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 3.5.0
73
- - - "<="
72
+ version: '3.10'
73
+ - - "<"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.6'
75
+ version: '4.0'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rspec-its
78
78
  requirement: !ruby/object:Gem::Requirement
@@ -93,14 +93,28 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.50'
96
+ version: '0.83'
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.83'
104
+ - !ruby/object:Gem::Dependency
105
+ name: rubocop-performance
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.5.2
97
111
  type: :development
98
112
  prerelease: false
99
113
  version_requirements: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '0.50'
117
+ version: 1.5.2
104
118
  - !ruby/object:Gem::Dependency
105
119
  name: highline
106
120
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +165,6 @@ extra_rdoc_files: []
151
165
  files:
152
166
  - ".gitignore"
153
167
  - ".rubocop.yml"
154
- - ".rubocop_todo.yml"
155
168
  - ".ruby-version"
156
169
  - CHANGELOG.md
157
170
  - Gemfile
@@ -176,6 +189,7 @@ files:
176
189
  - lib/vagrant-google/action/read_ssh_info.rb
177
190
  - lib/vagrant-google/action/read_state.rb
178
191
  - lib/vagrant-google/action/run_instance.rb
192
+ - lib/vagrant-google/action/setup_winrm_password.rb
179
193
  - lib/vagrant-google/action/start_instance.rb
180
194
  - lib/vagrant-google/action/stop_instance.rb
181
195
  - lib/vagrant-google/action/terminate_instance.rb
@@ -192,6 +206,7 @@ files:
192
206
  - tasks/acceptance.rake
193
207
  - tasks/boxes.rake
194
208
  - tasks/bundler.rake
209
+ - tasks/changelog.rake
195
210
  - tasks/lint.rake
196
211
  - tasks/test.rake
197
212
  - test/acceptance/base.rb
@@ -220,7 +235,7 @@ files:
220
235
  homepage: http://www.vagrantup.com
221
236
  licenses: []
222
237
  metadata: {}
223
- post_install_message:
238
+ post_install_message:
224
239
  rdoc_options: []
225
240
  require_paths:
226
241
  - lib
@@ -235,9 +250,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
250
  - !ruby/object:Gem::Version
236
251
  version: 1.3.6
237
252
  requirements: []
238
- rubyforge_project: vagrant-google
239
- rubygems_version: 2.6.14
240
- signing_key:
253
+ rubygems_version: 3.2.22
254
+ signing_key:
241
255
  specification_version: 4
242
256
  summary: Vagrant provider plugin for Google Compute Engine.
243
257
  test_files: []