gclouder 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gclouder/resource.rb +10 -4
- data/lib/gclouder/resources/container/node_pools.rb +1 -1
- data/lib/gclouder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ac083baef10e03cd7b8511ef19f0aefe57d2443
|
4
|
+
data.tar.gz: 5c9c516ddb5ed7f8646d5871849caae3b7b9bf7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b20abe4ff1eb7f87958976b444362e6bcc90049320e3bbfbaa65f68250da729eb7537f9879d6d476d74db7011f3a4dbcee0c8328a8097873172f8f994377d4e9
|
7
|
+
data.tar.gz: 10eb08892b53ae3083b3f6ff295550864ca449c1a1e9b49f3834360cfa6a05b33c11210758e0f04849d1afaaa0b99c5ce8f1e97ebd216ed82d6c81ec5cb15160
|
data/lib/gclouder/resource.rb
CHANGED
@@ -12,9 +12,15 @@ module GClouder
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.resource?(resource, name, args = nil, filter_key: "name", filter_value: nil, filter: "#{filter_key} ~ ^#{filter_value || name}$", project_id: nil, silent: false, extra_info: nil, indent: 3)
|
15
|
+
|
16
|
+
p "filter: #{filter}"
|
17
|
+
p "filter_key: #{filter_key}"
|
18
|
+
p "filter_value: #{filter_value}"
|
15
19
|
exists = \
|
16
20
|
gcloud("#{resource} list --filter '#{filter}' #{args} | jq '. | length'", force: true, project_id: project_id) > 0
|
17
21
|
|
22
|
+
puts "exists: #{exists}"
|
23
|
+
|
18
24
|
# if silent is specified then shell call returns boolean, otherwise integer
|
19
25
|
if exists.is_a?(Integer)
|
20
26
|
exists = exists > 0 ? true : false
|
@@ -33,14 +39,14 @@ module GClouder
|
|
33
39
|
gcloud "#{resource} describe #{name} #{args}", force: force, failure: failure, silent: silent, project_id: project_id
|
34
40
|
end
|
35
41
|
|
36
|
-
def self.ensure(resource, name, args = nil, project_id: nil, extra_info: nil, silent: false, indent: 3, filter_key: "name", filter:
|
37
|
-
return if resource?(resource, name, project_id: project_id, extra_info: extra_info, silent: silent, indent: indent, filter_key:
|
42
|
+
def self.ensure(resource, name, args = nil, project_id: nil, extra_info: nil, silent: false, indent: 3, filter_key: "name", filter_value: nil, filter: "#{filter_key} ~ ^#{filter_value || name}$")
|
43
|
+
return if resource?(resource, name, project_id: project_id, extra_info: extra_info, silent: silent, indent: indent, filter_key: "name", filter_value: nil, filter: "#{filter_key} ~ ^#{filter_value || name}$")
|
38
44
|
feedback("add", resource, name, extra_info: extra_info, indent: indent, silent: silent)
|
39
45
|
gcloud "#{resource} create #{name} #{args}", project_id: project_id, silent: silent
|
40
46
|
end
|
41
47
|
|
42
|
-
def self.purge(resource, name, args = nil, project_id: nil, silent: false, indent: 3, filter:
|
43
|
-
return unless resource?(resource, name, project_id: project_id, silent: true, indent: indent, filter:
|
48
|
+
def self.purge(resource, name, args = nil, project_id: nil, silent: false, indent: 3, filter_key: "name", filter_value: nil, filter: "#{filter_key} ~ ^#{filter_value || name}$")
|
49
|
+
return unless resource?(resource, name, project_id: project_id, silent: true, indent: indent, filter_key: "name", filter_value: nil, filter: "#{filter_key} ~ ^#{filter_value || name}$")
|
44
50
|
extra_info = "[skipped] (--purge not specified)" unless cli_args[:purge]
|
45
51
|
feedback("remove", resource, name, extra_info: extra_info, indent: indent, silent: silent)
|
46
52
|
gcloud "#{resource} delete #{name} #{args}", project_id: project_id if cli_args[:purge]
|
@@ -131,7 +131,7 @@ module GClouder
|
|
131
131
|
zone = pool["zone"]
|
132
132
|
|
133
133
|
if !check_exists?(cluster["name"], pool["name"], zone)
|
134
|
-
gcloud("
|
134
|
+
gcloud("container node-pools create --cluster #{cluster["name"]} #{parameters} #{pool["name"]}")
|
135
135
|
if cli_args[:dry_run]
|
136
136
|
add pool["name"], indent: 4
|
137
137
|
else
|
data/lib/gclouder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gclouder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Wilson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: trollop
|