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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95511ff6f5ee4864378cc09528959d8ae5ec2e89
4
- data.tar.gz: 81bc37875b4769332229a8f13b8012ded6855abc
3
+ metadata.gz: 6ac083baef10e03cd7b8511ef19f0aefe57d2443
4
+ data.tar.gz: 5c9c516ddb5ed7f8646d5871849caae3b7b9bf7f
5
5
  SHA512:
6
- metadata.gz: 13a5525977076e2cdb762d48c56e43ea6144cec5a25c40160ddaa56db6c7c0a290b7859a506551860fae107592c05263a0027842e2065559b39576e971515ad5
7
- data.tar.gz: 5645532cee099f4100ccafda530ae73cf77bad9dd18778bcf7baef7b507c8d26e8a67817cb56ef0a8f286b67eef2c679629babeeac13a35df5ae336e1a3251a3
6
+ metadata.gz: b20abe4ff1eb7f87958976b444362e6bcc90049320e3bbfbaa65f68250da729eb7537f9879d6d476d74db7011f3a4dbcee0c8328a8097873172f8f994377d4e9
7
+ data.tar.gz: 10eb08892b53ae3083b3f6ff295550864ca449c1a1e9b49f3834360cfa6a05b33c11210758e0f04849d1afaaa0b99c5ce8f1e97ebd216ed82d6c81ec5cb15160
@@ -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: nil)
37
- return if resource?(resource, name, project_id: project_id, extra_info: extra_info, silent: silent, indent: indent, filter_key: filter_key, filter: filter)
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: nil)
43
- return unless resource?(resource, name, project_id: project_id, silent: true, indent: indent, filter: 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("alpha container node-pools create --cluster #{cluster["name"]} #{parameters} #{pool["name"]}")
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
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module GClouder
4
- VERSION = "0.3.5"
4
+ VERSION = "0.3.6"
5
5
  end
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.5
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-01-25 00:00:00.000000000 Z
12
+ date: 2018-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: trollop