fluent-plugin-gcs 0.4.0 → 0.4.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 +4 -4
- data/.travis.yml +1 -2
- data/CHANGELOG.md +5 -0
- data/README.md +10 -1
- data/fluent-plugin-gcs.gemspec +1 -1
- data/lib/fluent/plugin/gcs/version.rb +1 -1
- data/lib/fluent/plugin/out_gcs.rb +11 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85b1b9b0ed8cd2b264dacc7f54fb1bf9e15b2f1e6f28871b17e0bb7e844e1669
|
4
|
+
data.tar.gz: a90fec1f3d5509be2df1a72d2479e9db6ba7f133ad67c60789abbdbb1360e519
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bcb9225215a56ea5ad0d34ac2447e0b39074ae9269e885c2ac70ba2679213340653b47941ea2c5c395861535fd565ae81a6e153e48adef175cf6966b1849a20
|
7
|
+
data.tar.gz: dfe13e0a8ea31f3d80d1174aa4c35385cf6206820d5574f31d501767e972b144f646a48711e64c63b10261045385aed4af9a2e7516aeeac0f6aa460cb37cf807
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -225,9 +225,18 @@ Use Local time instead of UTC.
|
|
225
225
|
|
226
226
|
Use UTC instead of local time.
|
227
227
|
|
228
|
-
|
229
228
|
And see [official Time Sliced Output article](http://docs.fluentd.org/articles/output-plugin-overview#time-sliced-output-parameters)
|
230
229
|
|
230
|
+
**blind_write**
|
231
|
+
|
232
|
+
Doesn't check if an object exists in GCS before writing. Default is false.
|
233
|
+
|
234
|
+
Allows to avoid granting of `storage.objects.get` permission.
|
235
|
+
|
236
|
+
Warning! If the object exists and `storage.objects.delete` permission is not
|
237
|
+
granted, it will result in an unrecoverable error. Usage of `%{hex_random}` is
|
238
|
+
recommended.
|
239
|
+
|
231
240
|
### ObjectMetadata
|
232
241
|
|
233
242
|
User provided web-safe keys and arbitrary string values that will returned with requests for the file as "x-goog-meta-" response headers.
|
data/fluent-plugin-gcs.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency "fluentd", [">= 0.14.22", "< 2"]
|
24
24
|
spec.add_runtime_dependency "google-cloud-storage", "~> 1.1"
|
25
25
|
|
26
|
-
spec.add_development_dependency "rake", "
|
26
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
27
27
|
spec.add_development_dependency "rr", "= 1.1.2"
|
28
28
|
spec.add_development_dependency "test-unit", ">= 3.0.8"
|
29
29
|
spec.add_development_dependency "test-unit-rr", ">= 1.0.3"
|
@@ -49,6 +49,8 @@ module Fluent::Plugin
|
|
49
49
|
desc: "Storage class of the file"
|
50
50
|
config_param :encryption_key, :string, default: nil, secret: true,
|
51
51
|
desc: "Customer-supplied, AES-256 encryption key"
|
52
|
+
config_param :blind_write, :bool, default: false,
|
53
|
+
desc: "Whether to check if object already exists by given GCS path. Allows avoiding giving storage.object.get permission"
|
52
54
|
config_section :object_metadata, required: false do
|
53
55
|
config_param :key, :string, default: ""
|
54
56
|
config_param :value, :string, default: ""
|
@@ -149,6 +151,14 @@ module Fluent::Plugin
|
|
149
151
|
Digest::MD5.hexdigest(chunk.unique_id)[0...@hex_random_length]
|
150
152
|
end
|
151
153
|
|
154
|
+
def check_object_exists(path)
|
155
|
+
if !@blind_write
|
156
|
+
return @gcs_bucket.find_file(path, @encryption_opts)
|
157
|
+
else
|
158
|
+
return false
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
152
162
|
def generate_path(chunk, i = 0, prev = nil)
|
153
163
|
metadata = chunk.metadata
|
154
164
|
time_slice = if metadata.timekey.nil?
|
@@ -167,7 +177,7 @@ module Fluent::Plugin
|
|
167
177
|
}
|
168
178
|
path = @object_key_format.gsub(Regexp.union(tags.keys), tags)
|
169
179
|
path = extract_placeholders(path, chunk)
|
170
|
-
return path unless
|
180
|
+
return path unless check_object_exists(path)
|
171
181
|
|
172
182
|
if path == prev
|
173
183
|
if @overwrite
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-gcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daichi HIRATA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -48,16 +48,16 @@ dependencies:
|
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 12.3.3
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: 12.3.3
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rr
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|