kitchen-google 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/gce.rb +30 -21
- data/lib/kitchen/driver/gce_version.rb +1 -1
- metadata +13 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49b9b4e9bb1cd2c7415d168d392f78f0dcc1151f5b7fa84d96b08fdac759a9bd
|
4
|
+
data.tar.gz: ff3bcefcf72654dcfe45ab567601174e54974e03bf19b80a3d6bc765cc807881
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96508c913564f0f724ae4551a07d9b82b57ddd73f14d82768a9b68851ab58850a6d5588880de2da0112fd13e710323c4849f32dc853935fb55e26add85fec978
|
7
|
+
data.tar.gz: fee4542d0f03cc5934dc5660d509c167f133f9ca6fd5fbee0d14b1c47cf9cb357427483e881d267f794215c7caaa764ae6aab6bde7a546659668a696b2f67eff
|
data/lib/kitchen/driver/gce.rb
CHANGED
@@ -32,25 +32,25 @@ module Kitchen
|
|
32
32
|
attr_accessor :state
|
33
33
|
|
34
34
|
SCOPE_ALIAS_MAP = {
|
35
|
-
"bigquery"
|
36
|
-
"cloud-platform"
|
37
|
-
"compute-ro"
|
38
|
-
"compute-rw"
|
39
|
-
"datastore"
|
40
|
-
"logging-write"
|
41
|
-
"monitoring"
|
42
|
-
"monitoring-write"
|
43
|
-
"service-control"
|
35
|
+
"bigquery" => "bigquery",
|
36
|
+
"cloud-platform" => "cloud-platform",
|
37
|
+
"compute-ro" => "compute.readonly",
|
38
|
+
"compute-rw" => "compute",
|
39
|
+
"datastore" => "datastore",
|
40
|
+
"logging-write" => "logging.write",
|
41
|
+
"monitoring" => "monitoring",
|
42
|
+
"monitoring-write" => "monitoring.write",
|
43
|
+
"service-control" => "servicecontrol",
|
44
44
|
"service-management" => "service.management",
|
45
|
-
"sql"
|
46
|
-
"sql-admin"
|
47
|
-
"storage-full"
|
48
|
-
"storage-ro"
|
49
|
-
"storage-rw"
|
50
|
-
"taskqueue"
|
51
|
-
"useraccounts-ro"
|
52
|
-
"useraccounts-rw"
|
53
|
-
"userinfo-email"
|
45
|
+
"sql" => "sqlservice",
|
46
|
+
"sql-admin" => "sqlservice.admin",
|
47
|
+
"storage-full" => "devstorage.full_control",
|
48
|
+
"storage-ro" => "devstorage.read_only",
|
49
|
+
"storage-rw" => "devstorage.read_write",
|
50
|
+
"taskqueue" => "taskqueue",
|
51
|
+
"useraccounts-ro" => "cloud.useraccounts.readonly",
|
52
|
+
"useraccounts-rw" => "cloud.useraccounts",
|
53
|
+
"userinfo-email" => "userinfo.email",
|
54
54
|
}.freeze
|
55
55
|
|
56
56
|
kitchen_driver_api_version 2
|
@@ -83,7 +83,7 @@ module Kitchen
|
|
83
83
|
default_config :metadata, {}
|
84
84
|
default_config :labels, {}
|
85
85
|
|
86
|
-
DISK_NAME_REGEX = /(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)
|
86
|
+
DISK_NAME_REGEX = /(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)/.freeze
|
87
87
|
|
88
88
|
def name
|
89
89
|
"Google Compute (GCE)"
|
@@ -192,6 +192,7 @@ module Kitchen
|
|
192
192
|
|
193
193
|
if disk_config[:disk_type] == "local-ssd"
|
194
194
|
raise "#{disk_name}: Cannot use 'disk_size' with local SSD. They always have 375 GB (https://cloud.google.com/compute/docs/disks/#localssds)." unless disk_config[:disk_size].nil?
|
195
|
+
|
195
196
|
# Since disk_size is set to 10 in default_config, it needs to be adjusted for local SSDs
|
196
197
|
config[:disks][disk_name.to_sym][:disk_size] = nil
|
197
198
|
end
|
@@ -295,31 +296,37 @@ module Kitchen
|
|
295
296
|
|
296
297
|
def valid_machine_type?
|
297
298
|
return false if config[:machine_type].nil?
|
299
|
+
|
298
300
|
check_api_call { connection.get_machine_type(project, zone, config[:machine_type]) }
|
299
301
|
end
|
300
302
|
|
301
303
|
def valid_network?
|
302
304
|
return false if config[:network].nil?
|
305
|
+
|
303
306
|
check_api_call { connection.get_network(network_project, config[:network]) }
|
304
307
|
end
|
305
308
|
|
306
309
|
def valid_subnet?
|
307
310
|
return false if config[:subnet].nil?
|
311
|
+
|
308
312
|
check_api_call { connection.get_subnetwork(subnet_project, region, config[:subnet]) }
|
309
313
|
end
|
310
314
|
|
311
315
|
def valid_zone?
|
312
316
|
return false if config[:zone].nil?
|
317
|
+
|
313
318
|
check_api_call { connection.get_zone(project, config[:zone]) }
|
314
319
|
end
|
315
320
|
|
316
321
|
def valid_region?
|
317
322
|
return false if config[:region].nil?
|
323
|
+
|
318
324
|
check_api_call { connection.get_region(project, config[:region]) }
|
319
325
|
end
|
320
326
|
|
321
327
|
def valid_disk_type?(disk_type)
|
322
328
|
return false if disk_type.nil?
|
329
|
+
|
323
330
|
check_api_call { connection.get_disk_type(project, zone, disk_type) }
|
324
331
|
end
|
325
332
|
|
@@ -528,9 +535,9 @@ module Kitchen
|
|
528
535
|
|
529
536
|
def metadata
|
530
537
|
default_metadata = {
|
531
|
-
"created-by"
|
538
|
+
"created-by" => "test-kitchen",
|
532
539
|
"test-kitchen-instance" => instance.name,
|
533
|
-
"test-kitchen-user"
|
540
|
+
"test-kitchen-user" => env_user,
|
534
541
|
}
|
535
542
|
if winrm_transport?
|
536
543
|
image_identifier = config[:image_family] || config[:image_name]
|
@@ -577,6 +584,7 @@ module Kitchen
|
|
577
584
|
|
578
585
|
def subnet_url
|
579
586
|
return unless config[:subnet]
|
587
|
+
|
580
588
|
"projects/#{subnet_project}/regions/#{region}/subnetworks/#{config[:subnet]}"
|
581
589
|
end
|
582
590
|
|
@@ -626,6 +634,7 @@ module Kitchen
|
|
626
634
|
|
627
635
|
def service_account_scope_url(scope)
|
628
636
|
return scope if scope.start_with?("https://www.googleapis.com/auth/")
|
637
|
+
|
629
638
|
"https://www.googleapis.com/auth/#{translate_scope_alias(scope)}"
|
630
639
|
end
|
631
640
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-google
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Leonard
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-11-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gcewinpass
|
@@ -29,16 +29,22 @@ dependencies:
|
|
29
29
|
name: google-api-client
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.23.9
|
35
|
+
- - "<"
|
33
36
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
37
|
+
version: 0.35.0
|
35
38
|
type: :runtime
|
36
39
|
prerelease: false
|
37
40
|
version_requirements: !ruby/object:Gem::Requirement
|
38
41
|
requirements:
|
39
|
-
- - "
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 0.23.9
|
45
|
+
- - "<"
|
40
46
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
47
|
+
version: 0.35.0
|
42
48
|
- !ruby/object:Gem::Dependency
|
43
49
|
name: test-kitchen
|
44
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,8 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
159
|
- !ruby/object:Gem::Version
|
154
160
|
version: '0'
|
155
161
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 2.7.7
|
162
|
+
rubygems_version: 3.0.3
|
158
163
|
signing_key:
|
159
164
|
specification_version: 4
|
160
165
|
summary: Kitchen::Driver::Gce
|