kubetailrb 0.3.2 → 0.3.3
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/kubetailrb/cmd/help.rb +1 -1
- data/lib/kubetailrb/cmd/k8s.rb +22 -8
- data/lib/kubetailrb/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: 5ef04b916de92589cb98bac04813a76ea95f763250af27f9212271088b144bc3
|
|
4
|
+
data.tar.gz: c928856a0949ea26bdbdddeeb31754fc83edc8f1b9d4f9680197d1bb209bcb3c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b28fe6c39843832ed4cd944455024cb4169226d1cc508b486cb1ebc5770a7492c6abc7bff34ada5244b1b301730d20a04978243fbb0be82871a149f4d66fb690
|
|
7
|
+
data.tar.gz: 16de81e80ae6f367adf781b5a217650662f4fe6ed17018726ce0306fcdc91e697413b98edf4a38dc2dd704c9da61effd3fc8ea2dd76dc3a997751f9d49860985
|
data/lib/kubetailrb/cmd/help.rb
CHANGED
data/lib/kubetailrb/cmd/k8s.rb
CHANGED
|
@@ -21,6 +21,14 @@ module Kubetailrb
|
|
|
21
21
|
|
|
22
22
|
MDCS_FLAGS = %w[-m --mdcs].freeze
|
|
23
23
|
|
|
24
|
+
FLAGS_WITH_VALUES = (
|
|
25
|
+
NAMESPACE_FLAGS +
|
|
26
|
+
[TAIL_FLAG] +
|
|
27
|
+
CONTAINER_FLAGS +
|
|
28
|
+
EXCLUDES_FLAGS +
|
|
29
|
+
MDCS_FLAGS
|
|
30
|
+
).freeze
|
|
31
|
+
|
|
24
32
|
attr_reader :reader
|
|
25
33
|
|
|
26
34
|
def initialize(pod_query:, container_query:, opts:)
|
|
@@ -38,7 +46,7 @@ module Kubetailrb
|
|
|
38
46
|
class << self
|
|
39
47
|
def create(*args)
|
|
40
48
|
new(
|
|
41
|
-
pod_query: parse_pod_query(
|
|
49
|
+
pod_query: parse_pod_query(args),
|
|
42
50
|
container_query: parse_container_query(*args),
|
|
43
51
|
opts: K8sOpts.new(
|
|
44
52
|
namespace: parse_namespace(*args),
|
|
@@ -52,15 +60,21 @@ module Kubetailrb
|
|
|
52
60
|
)
|
|
53
61
|
end
|
|
54
62
|
|
|
55
|
-
def parse_pod_query(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# The above command will not work because this method will return 3
|
|
60
|
-
# instead of 'some-pod'...
|
|
61
|
-
args.find { |arg| !arg.start_with? '-' }
|
|
63
|
+
def parse_pod_query(args)
|
|
64
|
+
args.each_with_index.find do |arg, idx|
|
|
65
|
+
!arg.start_with?('-') && !consumed_by_flag?(args, idx)
|
|
66
|
+
end&.first
|
|
62
67
|
end
|
|
63
68
|
|
|
69
|
+
private
|
|
70
|
+
|
|
71
|
+
def consumed_by_flag?(args, idx)
|
|
72
|
+
prev = args[idx - 1]
|
|
73
|
+
FLAGS_WITH_VALUES.include?(prev)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
public
|
|
77
|
+
|
|
64
78
|
#
|
|
65
79
|
# Parse k8s namespace from arguments provided in the CLI, e.g.
|
|
66
80
|
#
|
data/lib/kubetailrb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kubetailrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Louis Lin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-06-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: kubeclient
|