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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1199ab8d0ac81fc5f30f69f908205ae7e8a7e1eb1142310eb8532a581a8036c
4
- data.tar.gz: 02131efa98c4ce38ec97c9e32c28942be9357720e1c894914c6630b4dd8062db
3
+ metadata.gz: cbe8ec23d60bcc04c315d7961b841fd7f0ccd7ba3c2133e1fd7db537dcbc4e3c
4
+ data.tar.gz: a02f9f5241b9ab760b9f9c6cf6eb8a29f8667c3dbfd23ae0a761195e9eee69b2
5
5
  SHA512:
6
- metadata.gz: 50726236669da194d7bb92fccb9d1aa77cfbfba6f181d194485050d8475457d3f4046e87fbc4a87a52e4e263ebf3cf837390f8e34fa271599a2910e3a8cf0aa8
7
- data.tar.gz: 01bcb89ce5ddea1f0a3ca4ae365bf7f337c597d5256243709234215aaf49a1ba0488d2baaca0f0f394eceefeb752a016dece5581866235afd9e4984932fbd63c
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 !auth_config[:config_file_location].nil?
168
- auth_config[:auth_type] = auth_config[:auth_type] ||= Enum::AuthTypeEnum::CONFIG
169
- else
170
- auth_config[:auth_type] = auth_config[:auth_type] ||= Enum::AuthTypeEnum::INSTANCE_PRINCIPAL
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
@@ -5,6 +5,6 @@ module Enum
5
5
  module AuthTypeEnum
6
6
  CONFIG = 'config'.freeze
7
7
  INSTANCE_PRINCIPAL = 'instance_principal'.freeze
8
- # OKE_WORKLOAD_IDENTITY = 'oke_workload_identity'.freeze
8
+ OKE_WORKLOAD_IDENTITY = 'oke_workload_identity'.freeze
9
9
  end
10
10
  end
@@ -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
- # elsif @auth_type == Enum::AuthTypeEnum::OKE_WORKLOAD_IDENTITY
60
- # @workload_identity_signer = OCI::Auth::Signers::oke_workload_resource_principal_signer
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
- # workload_identity_signer: @workload_identity_signer,
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
@@ -2,5 +2,5 @@
2
2
  ## The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
3
3
 
4
4
  module Discovery
5
- VERSION = '1.3.0'.freeze
5
+ VERSION = '1.4.0'.freeze
6
6
  end
data/ocibuild.conf CHANGED
@@ -22,11 +22,8 @@ steps:
22
22
  type: publishgeneric
23
23
  dependsOn: ruby_install
24
24
  repository: logan-release-gems-local
25
- filePathsToPublish [
26
- {
27
- localFile: "*.gem",
28
- targetDir: "gem/"
29
- }
30
- ]
25
+ filesToPublish: [
26
+ "*.gem"
27
+ ]
31
28
  }
32
29
  ]
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.3.0
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-02-11 00:00:00.000000000 Z
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