hoobskubes 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hoobskubes.rb +28 -16
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9404390966cc2fdf60d8a90dcb81dc9b04516f8b90b5706f0921fe07694c982
|
|
4
|
+
data.tar.gz: 27bf8427f2ec3dd7b9b016236a546138476498fc46aedd112d62ea313cd016dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf5f2781a2b577239b02bc5d4c0ff607ba2a91c86ffcfd85c37c3c876f6f9d879dfbce381c72a0c953552f4bd5ab76305b07ba9848d19921f800ded5bfc4fd86
|
|
7
|
+
data.tar.gz: 30876fcd324a005b858e4967512a4e378016e7000fd6c2d97d36e02fe020dd4f438ee0f1164a83a6d2744c37157811639b58052b3e1acc14e8482a10803e1bfc
|
data/lib/hoobskubes.rb
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
require 'optparse'
|
|
2
|
+
require 'ostruct'
|
|
3
|
+
|
|
1
4
|
class HoobsKubes
|
|
2
5
|
def self.current_context
|
|
3
6
|
%x{kubectl config current-context}.strip
|
|
@@ -15,7 +18,7 @@ class HoobsKubes
|
|
|
15
18
|
|
|
16
19
|
def self.pretty_print_table(resource, namespace=nil)
|
|
17
20
|
extra = resource == "nodes" ? " -Lbeta.kubernetes.io/instance-type -Lfailure-domain.beta.kubernetes.io/zone" : ""
|
|
18
|
-
all = @@all ? " --all-namespaces" : ""
|
|
21
|
+
all = @@options.all ? " --all-namespaces" : ""
|
|
19
22
|
|
|
20
23
|
if namespace.nil?
|
|
21
24
|
out = %x{kubectl get #{resource}#{extra}#{all}}
|
|
@@ -89,23 +92,32 @@ class HoobsKubes
|
|
|
89
92
|
|
|
90
93
|
def self.run(dir)
|
|
91
94
|
@@dir = dir
|
|
92
|
-
@@
|
|
95
|
+
@@options = OpenStruct.new
|
|
96
|
+
@@options.status = false
|
|
97
|
+
@@options.all = false
|
|
98
|
+
@@options.change = false
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
OptionParser.new do |opts|
|
|
101
|
+
opts.banner = "Usage: deploy.rb [options]"
|
|
102
|
+
|
|
103
|
+
opts.on("-s", "--status", "Displays status only") do |v|
|
|
104
|
+
@@options.status = true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
opts.on("-a", "--all", "Displays status for all namespaces") do |v|
|
|
108
|
+
@@options.all = true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
opts.on("-c", "--change-context", "Change context without deploying") do |v|
|
|
112
|
+
@@options.change = true
|
|
113
|
+
end
|
|
114
|
+
end.parse!
|
|
115
|
+
|
|
116
|
+
if @@options.status or @@options.change
|
|
117
|
+
change_context if @@options.change
|
|
118
|
+
do_status if @@options.status
|
|
107
119
|
else
|
|
108
|
-
|
|
120
|
+
do_deploy
|
|
109
121
|
end
|
|
110
122
|
end
|
|
111
123
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hoobskubes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Colburn
|
|
@@ -10,7 +10,7 @@ bindir: bin
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2019-02-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
13
|
+
description: Kubernetes configuration deployment
|
|
14
14
|
email: samuel.colburn@gmail.com
|
|
15
15
|
executables: []
|
|
16
16
|
extensions: []
|