Skip to content

Commit

Permalink
chore(gemspec): update fluentd >= 1.14.x
Browse files Browse the repository at this point in the history
 - update fluentd to 1.14.x gem
 - update json gem to 2.5.1
 - fix deprecation warnings during rake tests: `common.rb:114: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open`

Fluentd changelog for [v1.14.x](https://github.com/fluent/fluentd/blob/master/CHANGELOG.md#v1140)

Signed-off-by: Anton Ouzounov <[email protected]>
  • Loading branch information
Anton Ouzounov committed Nov 10, 2021
1 parent 2a830e4 commit 00d1253
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions fluent-plugin-google-cloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ eos
gem.homepage =
'https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud'
gem.license = 'Apache-2.0'
gem.version = '0.12.3'
gem.version = '0.13.0'
gem.authors = ['Stackdriver Agents Team']
gem.email = ['[email protected]']
gem.required_ruby_version = Gem::Requirement.new('>= 2.2')
Expand All @@ -22,14 +22,14 @@ eos
# Note: In order to update the Fluentd version, please update both here and
# also the fluentd version in
# https://github.com/GoogleCloudPlatform/google-fluentd/blob/master/config/software/fluentd.rb.
gem.add_runtime_dependency 'fluentd', '1.13.3'
gem.add_runtime_dependency 'fluentd', '~> 1.14.0'
gem.add_runtime_dependency 'googleapis-common-protos', '1.3.10'
gem.add_runtime_dependency 'googleauth', '0.9.0'
gem.add_runtime_dependency 'google-api-client', '0.30.8'
gem.add_runtime_dependency 'google-cloud-logging', '1.6.6'
gem.add_runtime_dependency 'google-cloud-logging', '1.7.0'
gem.add_runtime_dependency 'google-protobuf', '3.17.3'
gem.add_runtime_dependency 'grpc', '1.31.1'
gem.add_runtime_dependency 'json', '2.4.1'
gem.add_runtime_dependency 'json', '2.5.1'
gem.add_runtime_dependency 'opencensus', '0.5.0'
gem.add_runtime_dependency 'opencensus-stackdriver', '0.4.1'

Expand Down
9 changes: 4 additions & 5 deletions lib/fluent/plugin/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def detect_platform(use_metadata_service)
end

begin
open('http://' + METADATA_SERVICE_ADDR, proxy: false) do |f|
URI.open('http://' + METADATA_SERVICE_ADDR, proxy: false) do |f|
if f.meta['metadata-flavor'] == 'Google'
@log.info 'Detected GCE platform'
return Platform::GCE
Expand All @@ -133,9 +133,8 @@ def fetch_gce_metadata(platform, metadata_path)
raise "Called fetch_gce_metadata with platform=#{platform}" unless
platform == Platform::GCE
# See https://cloud.google.com/compute/docs/metadata
open('http://' + METADATA_SERVICE_ADDR + '/computeMetadata/v1/' +
metadata_path, 'Metadata-Flavor' => 'Google', :proxy => false,
&:read)
URI.open('http://' + METADATA_SERVICE_ADDR + '/computeMetadata/v1/' +
metadata_path, 'Metadata-Flavor' => 'Google', :proxy => false, &:read)
end

# EC2 Metadata server returns everything in one call. Store it after the
Expand All @@ -145,7 +144,7 @@ def ec2_metadata(platform)
platform == Platform::EC2
unless @ec2_metadata
# See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
open('http://' + METADATA_SERVICE_ADDR +
URI.open('http://' + METADATA_SERVICE_ADDR +
'/latest/dynamic/instance-identity/document', proxy: false) do |f|
contents = f.read
@ec2_metadata = JSON.parse(contents)
Expand Down

0 comments on commit 00d1253

Please sign in to comment.