oci-logging-analytics-kubernetes-discovery 1.3.0 → 1.4.0
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/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/bin/oci-loganalytics-kubernetes-discovery +13 -4
- data/lib/enum/auth_type_enum.rb +1 -1
- data/lib/util/oci_clients.rb +57 -4
- data/lib/version.rb +1 -1
- data/ocibuild.conf +3 -6
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbe8ec23d60bcc04c315d7961b841fd7f0ccd7ba3c2133e1fd7db537dcbc4e3c
|
|
4
|
+
data.tar.gz: a02f9f5241b9ab760b9f9c6cf6eb8a29f8667c3dbfd23ae0a761195e9eee69b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d086d772a3f91bddd8f85d1627cbb825cb2373aff0e55cbef28a9d28dabded567170df1a778f176682812f693a6baf49067631f510eace5e2de5a44500b119f2
|
|
7
|
+
data.tar.gz: 1dcd772179a5c037c23924f685d23716f788cd78db2d254c64b77ccacd2528b87132ab726e95c109ddd33d6d7e3ce94c5ef825f7aa8f918ece96880d5a5fada6
|
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
logan-kubernetes-discovery
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-3.1.5
|
|
@@ -115,6 +115,13 @@ begin
|
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
+
# Valid oci_domain format check
|
|
119
|
+
unless auth_config[:oci_domain].nil?
|
|
120
|
+
unless auth_config[:oci_domain].match?(/^[a-z0-9-]+\.oci\.[a-z0-9.]+[a-z0-9]$/i)
|
|
121
|
+
raise OptionParser::InvalidOption, "--oci_domain '#{auth_config[:oci_domain]}' | " \
|
|
122
|
+
"expected format: <region>.oci.<domain> (e.g., us-ashburn-1.oci.oraclecloud.com)"
|
|
123
|
+
end
|
|
124
|
+
end
|
|
118
125
|
# If threads are enabled, thread count and queue size should be provided as arguments.
|
|
119
126
|
if app_config[:enable_threading] && app_config[:thread_count].nil?
|
|
120
127
|
raise OptionParser::MissingArgument, '--thread_count'
|
|
@@ -164,10 +171,12 @@ cluster_config[:oci_la_cluster_entity_id] = cluster_config[:oci_la_cluster_entit
|
|
|
164
171
|
cluster_config[:kubernetes_resourcename_prefix] = cluster_config[:kubernetes_resourcename_prefix] ||= 'oci-onm'
|
|
165
172
|
|
|
166
173
|
# OCI Auth Type
|
|
167
|
-
if
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
if auth_config[:auth_type].nil?
|
|
175
|
+
if !auth_config[:config_file_location].nil?
|
|
176
|
+
auth_config[:auth_type] = Enum::AuthTypeEnum::CONFIG
|
|
177
|
+
else
|
|
178
|
+
auth_config[:auth_type] = Enum::AuthTypeEnum::INSTANCE_PRINCIPAL
|
|
179
|
+
end
|
|
171
180
|
end
|
|
172
181
|
|
|
173
182
|
# OCI Domain
|
data/lib/enum/auth_type_enum.rb
CHANGED
data/lib/util/oci_clients.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Util
|
|
|
14
14
|
module_function
|
|
15
15
|
|
|
16
16
|
attr_accessor :oci_clients, :ce_client, :id_client, :lb_client, :la_client, :rs_client,
|
|
17
|
-
:vcn_client, :oci_config, :instance_principals_signer, :la_endpoint,
|
|
17
|
+
:vcn_client, :oci_config, :instance_principals_signer, :workload_identity_signer , :la_endpoint,
|
|
18
18
|
:auth_type, :auth_config_object, :oci_domain, :oci_retry_config, :oci_region
|
|
19
19
|
|
|
20
20
|
# This must be the first method called before any other method
|
|
@@ -56,8 +56,38 @@ module Util
|
|
|
56
56
|
)
|
|
57
57
|
end
|
|
58
58
|
@oci_region = @instance_principals_signer.region
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
elsif @auth_type == Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
60
|
+
@oci_config = OCI::Config.new
|
|
61
|
+
@workload_identity_signer = OCI::Auth::Signers.oke_workload_resource_principal_signer
|
|
62
|
+
if !@oci_domain.nil?
|
|
63
|
+
region_match = @oci_domain.match(/^([a-z0-9-]+)\.oci\./i)
|
|
64
|
+
if region_match
|
|
65
|
+
@oci_region = region_match[1]
|
|
66
|
+
logger.info("Extracted region from domain: #{@oci_region}")
|
|
67
|
+
else
|
|
68
|
+
raise StandardError, "Invalid oci_domain format: '#{@oci_domain}'. " \
|
|
69
|
+
"Expected: <region>.oci.<domain> (e.g., us-ashburn-1.oci.oraclecloud.com)"
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
begin
|
|
73
|
+
tmp_signer = OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner.new
|
|
74
|
+
if tmp_signer.region
|
|
75
|
+
@oci_region = tmp_signer.region
|
|
76
|
+
logger.info("extracted region from IMDS: #{@oci_region}")
|
|
77
|
+
else
|
|
78
|
+
raise StandardError, "IMDS returned nil region. " \
|
|
79
|
+
"Provide --oci_domain parameter (e.g., us-ashburn-1.oci.oraclecloud.com)."
|
|
80
|
+
end
|
|
81
|
+
rescue StandardError => e
|
|
82
|
+
raise
|
|
83
|
+
rescue => e
|
|
84
|
+
raise StandardError, "Unable to determine region. " \
|
|
85
|
+
"IMDS not available: #{e.message}. " \
|
|
86
|
+
"Provide --oci_domain parameter (e.g., us-ashburn-1.oci.oraclecloud.com)."
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
@oci_config.region = @oci_region
|
|
90
|
+
|
|
61
91
|
elsif @auth_type == Enum::AuthTypeEnum::CONFIG
|
|
62
92
|
@oci_config = OCI::ConfigFileLoader.load_config(config_file_location: auth_config_hash[:config_file_location],
|
|
63
93
|
profile_name: auth_config_hash[:profile_name])
|
|
@@ -132,6 +162,11 @@ module Util
|
|
|
132
162
|
config: @oci_config, endpoint: endpoint,
|
|
133
163
|
signer: @instance_principals_signer,
|
|
134
164
|
retry_config: retry_config)
|
|
165
|
+
when Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
166
|
+
client = OCI::ContainerEngine::ContainerEngineClient.new(
|
|
167
|
+
config: @oci_config, endpoint: endpoint,
|
|
168
|
+
signer: @workload_identity_signer,
|
|
169
|
+
retry_config: retry_config)
|
|
135
170
|
else
|
|
136
171
|
logger.warn("Unknown auth_type '#{@auth_type}' provided for container engine client.")
|
|
137
172
|
end
|
|
@@ -159,6 +194,8 @@ module Util
|
|
|
159
194
|
client = OCI::Identity::IdentityClient.new(config: @oci_config, endpoint: endpoint, retry_config: retry_config)
|
|
160
195
|
when Enum::AuthTypeEnum::INSTANCE_PRINCIPAL
|
|
161
196
|
client = OCI::Identity::IdentityClient.new(config: @oci_config, endpoint: endpoint, signer: @instance_principals_signer, retry_config: retry_config)
|
|
197
|
+
when Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
198
|
+
client = OCI::Identity::IdentityClient.new(config: @oci_config, endpoint: endpoint, signer: @workload_identity_signer, retry_config: retry_config)
|
|
162
199
|
else
|
|
163
200
|
logger.warn("Unknown auth_type '#{@auth_type}' provided for identity client.")
|
|
164
201
|
end
|
|
@@ -186,6 +223,8 @@ module Util
|
|
|
186
223
|
client = OCI::LoadBalancer::LoadBalancerClient.new(config: @oci_config, endpoint: endpoint, retry_config: retry_config)
|
|
187
224
|
when Enum::AuthTypeEnum::INSTANCE_PRINCIPAL
|
|
188
225
|
client = OCI::LoadBalancer::LoadBalancerClient.new(config: @oci_config, endpoint: endpoint, signer: @instance_principals_signer, retry_config: retry_config)
|
|
226
|
+
when Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
227
|
+
client = OCI::LoadBalancer::LoadBalancerClient.new(config: @oci_config, endpoint: endpoint, signer: @workload_identity_signer, retry_config: retry_config)
|
|
189
228
|
else
|
|
190
229
|
logger.warn("Unknown auth_type '#{@auth_type}' provided for load balancer client.")
|
|
191
230
|
end
|
|
@@ -221,6 +260,11 @@ module Util
|
|
|
221
260
|
endpoint: endpoint,
|
|
222
261
|
signer: @instance_principals_signer,
|
|
223
262
|
retry_config: retry_config)
|
|
263
|
+
when Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
264
|
+
client = OCI::LogAnalytics::LogAnalyticsClient.new(config: @oci_config,
|
|
265
|
+
endpoint: endpoint,
|
|
266
|
+
signer: @workload_identity_signer,
|
|
267
|
+
retry_config: retry_config)
|
|
224
268
|
else
|
|
225
269
|
logger.warn("Unknown auth_type while creating log analytics client: #{@auth_type}")
|
|
226
270
|
raise StandardError, 'Unknown auth_type for log analytics client.'
|
|
@@ -252,6 +296,8 @@ module Util
|
|
|
252
296
|
client = OCI::ResourceSearch::ResourceSearchClient.new(config: @oci_config, endpoint: endpoint, retry_config: retry_config)
|
|
253
297
|
when Enum::AuthTypeEnum::INSTANCE_PRINCIPAL
|
|
254
298
|
client = OCI::ResourceSearch::ResourceSearchClient.new(config: @oci_config, endpoint: endpoint, signer: @instance_principals_signer, retry_config: retry_config)
|
|
299
|
+
when Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
300
|
+
client = OCI::ResourceSearch::ResourceSearchClient.new(config: @oci_config, endpoint: endpoint, signer: @workload_identity_signer, retry_config: retry_config)
|
|
255
301
|
else
|
|
256
302
|
logger.warn("Unknown auth_type '#{@auth_type}' provided for resource search client.")
|
|
257
303
|
end
|
|
@@ -284,6 +330,8 @@ module Util
|
|
|
284
330
|
client = OCI::Core::VirtualNetworkClient.new(config: @oci_config, endpoint: endpoint, retry_config: retry_config)
|
|
285
331
|
when Enum::AuthTypeEnum::INSTANCE_PRINCIPAL
|
|
286
332
|
client = OCI::Core::VirtualNetworkClient.new(config: @oci_config, endpoint: endpoint, signer: @instance_principals_signer, retry_config: retry_config)
|
|
333
|
+
when Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
334
|
+
client = OCI::Core::VirtualNetworkClient.new(config: @oci_config, endpoint: endpoint, signer: @workload_identity_signer, retry_config: retry_config)
|
|
287
335
|
else
|
|
288
336
|
logger.warn("Unknown auth_type '#{@auth_type}' provided for virtual network client.")
|
|
289
337
|
end
|
|
@@ -317,6 +365,11 @@ module Util
|
|
|
317
365
|
endpoint: endpoint,
|
|
318
366
|
signer: @instance_principals_signer,
|
|
319
367
|
retry_config: retry_config)
|
|
368
|
+
when Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
|
|
369
|
+
client = OCI::ResourceManager::ResourceManagerClient.new(config: @oci_config,
|
|
370
|
+
endpoint: endpoint,
|
|
371
|
+
signer: @workload_identity_signer,
|
|
372
|
+
retry_config: retry_config)
|
|
320
373
|
else
|
|
321
374
|
logger.warn("Unknown auth_type '#{auth_object[:auth_type]}' provided for resource manager client.")
|
|
322
375
|
end
|
|
@@ -338,7 +391,7 @@ module Util
|
|
|
338
391
|
oci_config: @oci_config,
|
|
339
392
|
la_endpoint: @la_endpoint,
|
|
340
393
|
instance_principals_signer: @instance_principals_signer,
|
|
341
|
-
|
|
394
|
+
workload_identity_signer: @workload_identity_signer,
|
|
342
395
|
auth_type: @auth_type,
|
|
343
396
|
oci_domain: @oci_domain
|
|
344
397
|
}.compact
|
data/lib/version.rb
CHANGED
data/ocibuild.conf
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oci-logging-analytics-kubernetes-discovery
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oracle
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-
|
|
12
|
+
date: 2026-10-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|
|
@@ -271,6 +271,8 @@ extensions: []
|
|
|
271
271
|
extra_rdoc_files: []
|
|
272
272
|
files:
|
|
273
273
|
- ".gitignore"
|
|
274
|
+
- ".ruby-gemset"
|
|
275
|
+
- ".ruby-version"
|
|
274
276
|
- ".travis.yml"
|
|
275
277
|
- Gemfile
|
|
276
278
|
- LICENSE.txt
|