fluent-plugin-kubernetes_metadata_filter 2.4.6 → 2.4.7
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b79c9bdf0078c411c16855d5447963bf0cf112545dbdd9ce482636ef5628b731
|
4
|
+
data.tar.gz: 2b1289c54f2ea7926d077d2ce1176b0470ed869e024577172e01b42a8f17c3e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e354cffb2942f9da443d7219d0cbf4b93463207ec188471b6c6e8a06b180655a2befd2500b9a55c62fb96a524025a6a77fb1fdd6a031295cad6394e767104439
|
7
|
+
data.tar.gz: 344d0cdd184e0bdab9c072367ead78b23a16ee69fd4c938ba460aa6213179a091c14fdc6dd3829d74a470307f6bd5dc680f9fc7226f066daaa1ac21bdfab9b09
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-kubernetes_metadata_filter (2.4.
|
4
|
+
fluent-plugin-kubernetes_metadata_filter (2.4.7)
|
5
5
|
fluentd (>= 0.14.0, < 1.10)
|
6
6
|
kubeclient (< 5)
|
7
7
|
lru_redux
|
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
domain_name (0.5.20190701)
|
27
27
|
unf (>= 0.0.5, < 1.0.0)
|
28
28
|
escape_utils (1.2.1)
|
29
|
-
ffi (1.
|
29
|
+
ffi (1.13.1)
|
30
30
|
ffi-compiler (1.0.1)
|
31
31
|
ffi (>= 1.0.0)
|
32
32
|
rake
|
@@ -59,17 +59,22 @@ GEM
|
|
59
59
|
ffi-compiler (>= 1.0, < 2.0)
|
60
60
|
http_parser.rb (0.6.0)
|
61
61
|
jaro_winkler (1.5.4)
|
62
|
-
|
62
|
+
jsonpath (1.0.5)
|
63
|
+
multi_json
|
64
|
+
to_regexp (~> 0.2.1)
|
65
|
+
kubeclient (4.8.0)
|
63
66
|
http (>= 3.0, < 5.0)
|
64
|
-
|
67
|
+
jsonpath (~> 1.0)
|
68
|
+
recursive-open-struct (~> 1.1, >= 1.1.1)
|
65
69
|
rest-client (~> 2.0)
|
66
70
|
lru_redux (1.1.0)
|
67
71
|
mime-types (3.3.1)
|
68
72
|
mime-types-data (~> 3.2015)
|
69
|
-
mime-types-data (3.2020.
|
73
|
+
mime-types-data (3.2020.0512)
|
70
74
|
mini_mime (1.0.2)
|
71
75
|
minitest (4.7.5)
|
72
76
|
msgpack (1.3.3)
|
77
|
+
multi_json (1.15.0)
|
73
78
|
netrc (0.11.0)
|
74
79
|
parallel (1.19.1)
|
75
80
|
parser (2.7.0.4)
|
@@ -78,7 +83,7 @@ GEM
|
|
78
83
|
public_suffix (4.0.3)
|
79
84
|
rainbow (3.0.0)
|
80
85
|
rake (13.0.1)
|
81
|
-
recursive-open-struct (1.1.
|
86
|
+
recursive-open-struct (1.1.2)
|
82
87
|
rest-client (2.1.0)
|
83
88
|
http-accept (>= 1.7.0, < 2.0)
|
84
89
|
http-cookie (>= 1.0.2, < 2.0)
|
@@ -104,12 +109,13 @@ GEM
|
|
104
109
|
docile (~> 1.1)
|
105
110
|
simplecov-html (~> 0.11)
|
106
111
|
simplecov-html (0.12.2)
|
107
|
-
strptime (0.2.
|
112
|
+
strptime (0.2.4)
|
108
113
|
test-unit (3.0.9)
|
109
114
|
power_assert
|
110
115
|
test-unit-rr (1.0.5)
|
111
116
|
rr (>= 1.1.1)
|
112
117
|
test-unit (>= 2.5.2)
|
118
|
+
to_regexp (0.2.1)
|
113
119
|
tzinfo (2.0.2)
|
114
120
|
concurrent-ruby (~> 1.0)
|
115
121
|
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.4.
|
7
|
+
gem.version = "2.4.7"
|
8
8
|
gem.authors = ["Jimmi Dyson"]
|
9
9
|
gem.email = ["jimmidyson@gmail.com"]
|
10
10
|
gem.description = %q{Filter plugin to add Kubernetes metadata}
|
@@ -82,11 +82,11 @@ module Fluent::Plugin
|
|
82
82
|
config_param :skip_master_url, :bool, default: false
|
83
83
|
config_param :skip_namespace_metadata, :bool, default: false
|
84
84
|
# The time interval in seconds for retry backoffs when watch connections fail.
|
85
|
-
config_param :watch_retry_interval, :
|
85
|
+
config_param :watch_retry_interval, :integer, default: 1
|
86
86
|
# The base number of exponential backoff for retries.
|
87
|
-
config_param :watch_retry_exponential_backoff_base, :
|
87
|
+
config_param :watch_retry_exponential_backoff_base, :integer, default: 2
|
88
88
|
# The maximum number of times to retry pod and namespace watches.
|
89
|
-
config_param :watch_retry_max_times, :
|
89
|
+
config_param :watch_retry_max_times, :integer, default: 10
|
90
90
|
|
91
91
|
def fetch_pod_metadata(namespace_name, pod_name)
|
92
92
|
log.trace("fetching pod metadata: #{namespace_name}/#{pod_name}") if log.trace?
|
@@ -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.4.
|
4
|
+
version: 2.4.7
|
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-
|
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
|