stax-helm 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stax/helm/deployment.rb +28 -0
- data/lib/stax/helm/pod.rb +1 -0
- data/lib/stax/helm/stern.rb +1 -0
- data/lib/stax/helm/version.rb +1 -1
- 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: 7beb0767d7b08899165a52b8e58886c667a3d4d74a1a9e0e5918d599d0e755f8
|
4
|
+
data.tar.gz: 913a768e730ccdb511c1e2477d25d0b4438e1f14cdd81bd79099fd1766ccf1ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b8aee9ce577d1ec38b3a33ce446ff00f44bde274bae2aa0b8cf5934eebae30f7831683c0ac8b79e6330951cacc98e3aa8b78e1f50fff31bffab5fbb90ca0283
|
7
|
+
data.tar.gz: 566b8097eb9e92660459b4cc252b7aa3c922df810417435a578c6a7d183111c6a70bc00322e6ee1e20a324ab7ada73b076cc7b11649343a0ac21c421ccde4dfc
|
data/lib/stax/helm/deployment.rb
CHANGED
@@ -3,11 +3,39 @@ module Stax
|
|
3
3
|
module Helm
|
4
4
|
class Cmd < Base
|
5
5
|
|
6
|
+
no_commands do
|
7
|
+
def helm_deployments
|
8
|
+
jsonpath = '{.items[*].metadata.name}'
|
9
|
+
%x[kubectl get deployments -o=jsonpath='#{jsonpath}' -l #{helm_selector}].split
|
10
|
+
end
|
11
|
+
|
12
|
+
## prompt user with a list of deployments to choose
|
13
|
+
def helm_ask_deployments(msg)
|
14
|
+
deployments = helm_deployments
|
15
|
+
if deployments.count > 1
|
16
|
+
puts deployments.each_with_index.map { |d, i| "#{i}: #{d}" }
|
17
|
+
resp = ask(msg, default: 'all')
|
18
|
+
if resp != 'all'
|
19
|
+
indices = resp.split.map(&:to_i)
|
20
|
+
deployments = Array(deployments.slice(*indices))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
deployments
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
6
27
|
desc 'deployments', 'list deployments'
|
7
28
|
def deployments
|
8
29
|
kubectl_run(:get, :deployments, '-l', helm_selector)
|
9
30
|
end
|
10
31
|
|
32
|
+
desc 'restart', 'restart deployments'
|
33
|
+
def restart
|
34
|
+
helm_ask_deployments('choose deployments').each do |deployment|
|
35
|
+
kubectl_run(:rollout, :restart, :deployment, deployment)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
11
39
|
end
|
12
40
|
end
|
13
41
|
end
|
data/lib/stax/helm/pod.rb
CHANGED
@@ -33,6 +33,7 @@ module Stax
|
|
33
33
|
|
34
34
|
desc 'logs [OPTIONS]', 'run kubectl logs with same options'
|
35
35
|
def logs(*args)
|
36
|
+
trap('SIGINT', 'EXIT') # clean exit with ctrl-c
|
36
37
|
args = [ '--all-containers', '--prefix', '--follow' ] if args.empty? # helpful default args
|
37
38
|
kubectl_run(:logs, '-l', helm_selector, *args)
|
38
39
|
end
|
data/lib/stax/helm/stern.rb
CHANGED
data/lib/stax/helm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stax-helm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|