google-cloud-env 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +1 -1
- data/lib/google/cloud/env/compute_metadata.rb +2 -1
- data/lib/google/cloud/env/version.rb +1 -1
- data/lib/google/cloud/env.rb +13 -0
- 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: ad4a496680f310900fc41089c24e9ec06ce45525b0770e48a2d856c14d779cc4
|
4
|
+
data.tar.gz: 9480e4bedae18e535ff6f6a1f88febc728cdd2586855afd5994a62383ca62226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cba25bf0603f67d9029d215bac97bac46b739da8d230d832a07d694e975c04034756f4a1e9c09100b57b9c5149fbccb9d7732d351021ad60f121999359161dfa
|
7
|
+
data.tar.gz: c1c2b2bf84d183e499252867dfa925f287e74abb8416728764205c32060a9487cb02ce4afe0197f1da9f4f77f3b66bd3381e256947c03db49776e7066f102fad
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 2.2.0 (2024-08-22)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* Provide a query for whether a logging agent is expected in the current environment ([#70](https://github.com/googleapis/ruby-cloud-env/issues/70))
|
8
|
+
* Require Ruby 3.0 or later ([#71](https://github.com/googleapis/ruby-cloud-env/issues/71))
|
9
|
+
|
10
|
+
### 2.1.1 (2024-02-01)
|
11
|
+
|
12
|
+
#### Bug Fixes
|
13
|
+
|
14
|
+
* Setting non-empty overrides simulates metadata server existence setting ([#64](https://github.com/googleapis/ruby-cloud-env/issues/64))
|
15
|
+
|
3
16
|
### 2.1.0 (2023-12-12)
|
4
17
|
|
5
18
|
#### Features
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Metadata Server.
|
|
10
10
|
|
11
11
|
## Supported Ruby Versions
|
12
12
|
|
13
|
-
This library is supported on Ruby
|
13
|
+
This library is supported on Ruby 3.0+.
|
14
14
|
|
15
15
|
In general, Google provides official support for CRuby versions that are
|
16
16
|
actively supported by the Ruby Core team -- that is, Ruby versions that are
|
@@ -389,12 +389,12 @@ module Google
|
|
389
389
|
retry_count: :default,
|
390
390
|
retry_timeout: :default
|
391
391
|
query = canonicalize_query query
|
392
|
-
raise MetadataServerNotResponding unless gce_check
|
393
392
|
if @overrides
|
394
393
|
@mutex.synchronize do
|
395
394
|
return lookup_override path, query if @overrides
|
396
395
|
end
|
397
396
|
end
|
397
|
+
raise MetadataServerNotResponding unless gce_check
|
398
398
|
retry_count = self.retry_count if retry_count == :default
|
399
399
|
retry_count += 1 if retry_count
|
400
400
|
retry_timeout = self.retry_timeout if retry_timeout == :default
|
@@ -845,6 +845,7 @@ module Google
|
|
845
845
|
@existence = :no
|
846
846
|
raise MetadataServerNotResponding
|
847
847
|
end
|
848
|
+
@existence = :confirmed
|
848
849
|
result = @overrides.lookup path, query: query
|
849
850
|
result ||= Response.new 404, "Not found", FLAVOR_HEADER
|
850
851
|
result
|
data/lib/google/cloud/env.rb
CHANGED
@@ -497,6 +497,19 @@ module Google
|
|
497
497
|
end
|
498
498
|
alias container_engine_namespace_id kubernetes_engine_namespace_id
|
499
499
|
|
500
|
+
##
|
501
|
+
# Determine whether the application is running in an environment where a
|
502
|
+
# Google Cloud logging agent is expected to be running. In such an
|
503
|
+
# environment, we expect that the standard output and error streams are
|
504
|
+
# likely to be parsed by the logging agent and log entries are written to
|
505
|
+
# the Google Cloud Logging service.
|
506
|
+
#
|
507
|
+
# @return [boolean]
|
508
|
+
#
|
509
|
+
def logging_agent_expected?
|
510
|
+
compute_engine? && !cloud_shell? && (app_engine? || knative? || kubernetes_engine?)
|
511
|
+
end
|
512
|
+
|
500
513
|
##
|
501
514
|
# Returns the global instance of {Google::Cloud::Env}.
|
502
515
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -59,10 +59,10 @@ homepage: https://github.com/googleapis/ruby-cloud-env
|
|
59
59
|
licenses:
|
60
60
|
- Apache-2.0
|
61
61
|
metadata:
|
62
|
-
changelog_uri: https://rubydoc.info/gems/google-cloud-env/2.
|
62
|
+
changelog_uri: https://rubydoc.info/gems/google-cloud-env/2.2.0/CHANGELOG.md
|
63
63
|
source_code_uri: https://github.com/googleapis/ruby-cloud-env
|
64
64
|
bug_tracker_uri: https://github.com/googleapis/ruby-cloud-env/issues
|
65
|
-
documentation_uri: https://rubydoc.info/gems/google-cloud-env/2.
|
65
|
+
documentation_uri: https://rubydoc.info/gems/google-cloud-env/2.2.0
|
66
66
|
post_install_message:
|
67
67
|
rdoc_options: []
|
68
68
|
require_paths:
|
@@ -71,14 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '3.0'
|
75
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.5.6
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Google Cloud Platform hosting environment information.
|