fluent-plugin-kubernetes_metadata_filter 2.5.0 → 2.5.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb4fedca66daf5e4073101607933eaf70d0ed6295cf8ac73207e70947b2bbe28
|
4
|
+
data.tar.gz: fb6a9d7a9e1eadfbb2d8e3c802611561d904ba4a7ed3948b5a305a140df848df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f86f7472899a36b95316e5b37fb03ab0b893f6fe58b13cb9b5957ef5557ee6e7efd82bf74fe20525644002ac86d65c8b95c1f9e96e617355c0021c9b8e3689b
|
7
|
+
data.tar.gz: 505c4a63b0e87f068eaff8530bcb75fb0efa1eeb0abd5796d5bd41f9d3c49cc4fe3e59be2553203ed5b7b2901cff7f91046763bfefd40eb4049240d295dd7107
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-kubernetes_metadata_filter (2.5.
|
4
|
+
fluent-plugin-kubernetes_metadata_filter (2.5.1)
|
5
5
|
fluentd (>= 0.14.0, < 1.12)
|
6
6
|
kubeclient (< 5)
|
7
7
|
lru_redux
|
@@ -58,8 +58,12 @@ GEM
|
|
58
58
|
http-parser (1.2.1)
|
59
59
|
ffi-compiler (>= 1.0, < 2.0)
|
60
60
|
http_parser.rb (0.6.0)
|
61
|
-
|
61
|
+
jsonpath (1.0.5)
|
62
|
+
multi_json
|
63
|
+
to_regexp (~> 0.2.1)
|
64
|
+
kubeclient (4.8.0)
|
62
65
|
http (>= 3.0, < 5.0)
|
66
|
+
jsonpath (~> 1.0)
|
63
67
|
recursive-open-struct (~> 1.1, >= 1.1.1)
|
64
68
|
rest-client (~> 2.0)
|
65
69
|
lru_redux (1.1.0)
|
@@ -69,6 +73,7 @@ GEM
|
|
69
73
|
mini_mime (1.0.2)
|
70
74
|
minitest (4.7.5)
|
71
75
|
msgpack (1.3.3)
|
76
|
+
multi_json (1.15.0)
|
72
77
|
netrc (0.11.0)
|
73
78
|
parallel (1.19.2)
|
74
79
|
parser (2.7.1.4)
|
@@ -113,6 +118,7 @@ GEM
|
|
113
118
|
test-unit-rr (1.0.5)
|
114
119
|
rr (>= 1.1.1)
|
115
120
|
test-unit (>= 2.5.2)
|
121
|
+
to_regexp (0.2.1)
|
116
122
|
tzinfo (2.0.2)
|
117
123
|
concurrent-ruby (~> 1.0)
|
118
124
|
tzinfo-data (1.2020.1)
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "fluent-plugin-kubernetes_metadata_filter"
|
7
|
-
gem.version = "2.5.
|
7
|
+
gem.version = "2.5.1"
|
8
8
|
gem.authors = ["Jimmi Dyson"]
|
9
9
|
gem.email = ["jimmidyson@gmail.com"]
|
10
10
|
gem.description = %q{Filter plugin to add Kubernetes metadata}
|
@@ -19,6 +19,13 @@
|
|
19
19
|
require_relative 'kubernetes_metadata_common'
|
20
20
|
|
21
21
|
module KubernetesMetadata
|
22
|
+
|
23
|
+
class GoneError < StandardError
|
24
|
+
def initialize(msg="410 Gone")
|
25
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
22
29
|
module WatchPods
|
23
30
|
|
24
31
|
include ::KubernetesMetadata::Common
|
@@ -39,6 +46,11 @@ module KubernetesMetadata
|
|
39
46
|
begin
|
40
47
|
pod_watcher ||= get_pods_and_start_watcher
|
41
48
|
process_pod_watcher_notices(pod_watcher)
|
49
|
+
rescue GoneError
|
50
|
+
# Expected error. Quietly go back through the loop in order to
|
51
|
+
# start watching from the latest resource versions
|
52
|
+
log.debug("410 Gone encountered. Restarting watch to reset resource versions.")
|
53
|
+
pod_watcher = nil
|
42
54
|
rescue Exception => e
|
43
55
|
@stats.bump(:pod_watch_failures)
|
44
56
|
if Thread.current[:pod_watch_retry_count] < @watch_retry_max_times
|
@@ -129,9 +141,14 @@ module KubernetesMetadata
|
|
129
141
|
# deleted but still processing logs
|
130
142
|
@stats.bump(:pod_cache_watch_delete_ignored)
|
131
143
|
when 'ERROR'
|
132
|
-
|
133
|
-
|
134
|
-
|
144
|
+
if notice.object && notice.object['code'] == 410
|
145
|
+
@stats.bump(:pod_watch_gone_notices)
|
146
|
+
raise GoneError
|
147
|
+
else
|
148
|
+
@stats.bump(:pod_watch_error_type_notices)
|
149
|
+
message = notice['object']['message'] if notice['object'] && notice['object']['message']
|
150
|
+
raise "Error while watching pods: #{message}"
|
151
|
+
end
|
135
152
|
else
|
136
153
|
reset_pod_watch_retry_stats
|
137
154
|
# Don't pay attention to creations, since the created pod may not
|
@@ -142,6 +142,20 @@ class DefaultPodWatchStrategyTest < WatchTest
|
|
142
142
|
'message' => 'some error message'
|
143
143
|
}
|
144
144
|
)
|
145
|
+
@gone = OpenStruct.new(
|
146
|
+
type: 'ERROR',
|
147
|
+
object: {
|
148
|
+
'code' => 410,
|
149
|
+
'kind' => 'Status',
|
150
|
+
'message' => 'too old resource version: 123 (391079)',
|
151
|
+
'metadata' => {
|
152
|
+
'name' => 'gone',
|
153
|
+
'namespace' => 'gone',
|
154
|
+
'uid' => 'gone_uid'
|
155
|
+
},
|
156
|
+
'reason' => 'Gone'
|
157
|
+
}
|
158
|
+
)
|
145
159
|
end
|
146
160
|
|
147
161
|
test 'pod list caches pods' do
|
@@ -230,6 +244,16 @@ class DefaultPodWatchStrategyTest < WatchTest
|
|
230
244
|
end
|
231
245
|
end
|
232
246
|
|
247
|
+
test 'pod watch raises a GoneError when a 410 Gone error is received' do
|
248
|
+
@cache['gone_uid'] = {}
|
249
|
+
@client.stub :watch_pods, [@gone] do
|
250
|
+
assert_raise KubernetesMetadata::GoneError do
|
251
|
+
process_pod_watcher_notices(start_pod_watch)
|
252
|
+
end
|
253
|
+
assert_equal(1, @stats[:pod_watch_gone_notices])
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
233
257
|
test 'pod watch retries when error is received' do
|
234
258
|
@client.stub :get_pods, @initial do
|
235
259
|
@client.stub :watch_pods, [@error] do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-kubernetes_metadata_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmi Dyson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
259
|
- !ruby/object:Gem::Version
|
260
260
|
version: '0'
|
261
261
|
requirements: []
|
262
|
-
rubygems_version: 3.
|
262
|
+
rubygems_version: 3.1.2
|
263
263
|
signing_key:
|
264
264
|
specification_version: 4
|
265
265
|
summary: Fluentd filter plugin to add Kubernetes metadata
|