kubeclient 4.11.0 → 4.12.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: 6fde357cc528d50c12d105ffe2513e2a2c16958a01183a71189be6bc6e80840c
4
- data.tar.gz: b6e50bae096e72b396068c6da958ecddd7c3d61e9b91c2f55c05e020c1489235
3
+ metadata.gz: 21e5de1343a8f393c8eef653af1bb41e061bbee7fafa5d8cedafe8c163653071
4
+ data.tar.gz: aebdf094e7b05239467c8120382e47b65c82e031092cfc728b605f158257800a
5
5
  SHA512:
6
- metadata.gz: e4bfabe573e6f6da11be4635df9b8f19b0d4bf39693f195befc95e484d3cd3a22b132f57659f9947917c51f227e9f11dad9b7a6c8d996bbaccc6007a9a74212d
7
- data.tar.gz: d99da69686d8548794c96ccfc943caa52e5156708f4ff717e84fb7c9f467c090f34426b8030bcbfc1daf68d09b54b3f1702152334c7769a429bac7280f567483
6
+ metadata.gz: 161d8585521513897f730c0c1ab5f060634533cff048e146819dfa5c93e60afbdb67a4ed314245d61e343f7eca891454b2022e4ed9ced0117d518a8c2eb78ffa
7
+ data.tar.gz: 7f42460a4528177faccc81526ffc0904a5a7cc89ac56013fe99c208b6ab6cc2e7f289e1a654cb67f5f85985ffcd98af4b9e93b49cd052963d4d333697f50a7d5
@@ -14,7 +14,7 @@ jobs:
14
14
  runs-on: ${{ matrix.os_and_command.os }}
15
15
  strategy:
16
16
  matrix:
17
- ruby: [ '2.7', '3.0', '3.1', 'ruby-head', 'truffleruby-head' ]
17
+ ruby: [ '2.7', '3.0', '3.1', '3.2', 'ruby-head', 'truffleruby-head' ]
18
18
  os_and_command:
19
19
  - os: macos-latest
20
20
  command: 'env TESTOPTS="--verbose" bundle exec rake test'
@@ -31,7 +31,7 @@ jobs:
31
31
  command: 'bundle exec rake rubocop'
32
32
  name: ${{ matrix.os_and_command.os }} ${{ matrix.ruby }} rake ${{ matrix.os_and_command.command }}
33
33
  steps:
34
- - uses: actions/checkout@v2
34
+ - uses: actions/checkout@v4
35
35
  # actions/setup-ruby did not support truffle or bundler caching
36
36
  - uses: ruby/setup-ruby@v1
37
37
  with:
data/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ Notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5
5
  Kubeclient release versioning follows [SemVer](https://semver.org/).
6
6
 
7
+ ## 4.12.0 - 2024-06-18
8
+
9
+ ### Added
10
+ - Add test coverage for Ruby 3.2 (#615)
11
+ - Allow a region when getting a signer for Aws::Sts (#507)
12
+ - Update the AWS STS endpoint to be regional as the method is now regional (#528)
13
+ - Assume role support for aws eks credentials (#630)
14
+
15
+ ### Fixed
16
+ - [v4.y] Regenerated expired test TLS certs by running `test/config/update_certs_k0s.rb`.
17
+ - [v4.y] Regenerated expired test TLS certs (#611)
18
+ - Regenerated expired test TLS certs (#632)
19
+
20
+ ### Changed
21
+ - Update actions/checkout (#590)
22
+ - chore(deps): update actions/checkout action to v4 (#619)
23
+
7
24
  ## 4.11.0 — 2022-12-22
8
25
 
9
26
  ### Removed
data/README.md CHANGED
@@ -313,10 +313,14 @@ require 'aws-sdk-core'
313
313
  credentials = Aws::Credentials.new(access_key, secret_key)
314
314
  # Or a profile
315
315
  credentials = Aws::SharedCredentials.new(profile_name: 'default').credentials
316
+ # Or for an STS Assumed Role Credentials or any other credential Provider other than Static Credentials
317
+ credentials = Aws::AssumeRoleCredentials.new({ client: sts_client, role_arn: role_arn, role_session_name: session_name })
316
318
 
319
+ # Kubeclient Auth Options
317
320
  auth_options = {
318
321
  bearer_token: Kubeclient::AmazonEksCredentials.token(credentials, eks_cluster_name)
319
322
  }
323
+
320
324
  client = Kubeclient::Client.new(
321
325
  eks_cluster_https_endpoint, 'v1', auth_options: auth_options
322
326
  )
@@ -7,7 +7,7 @@ module Kubeclient
7
7
  end
8
8
 
9
9
  class << self
10
- def token(credentials, eks_cluster)
10
+ def token(credentials, eks_cluster, region: 'us-east-1')
11
11
  begin
12
12
  require 'aws-sigv4'
13
13
  require 'base64'
@@ -20,17 +20,26 @@ module Kubeclient
20
20
  end
21
21
  # https://github.com/aws/aws-sdk-ruby/pull/1848
22
22
  # Get a signer
23
- # Note - sts only has ONE endpoint (not regional) so 'us-east-1' hardcoding should be OK
24
- signer = Aws::Sigv4::Signer.new(
25
- service: 'sts',
26
- region: 'us-east-1',
27
- credentials: credentials
28
- )
23
+ signer = if credentials.respond_to?(:credentials)
24
+ Aws::Sigv4::Signer.new(
25
+ service: 'sts',
26
+ region: region,
27
+ credentials_provider: credentials
28
+ )
29
+ else
30
+ Aws::Sigv4::Signer.new(
31
+ service: 'sts',
32
+ region: region,
33
+ credentials: credentials
34
+ )
35
+ end
36
+
37
+ credentials = credentials.credentials if credentials.respond_to?(:credentials)
29
38
 
30
39
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Sigv4/Signer.html#presign_url-instance_method
31
40
  presigned_url_string = signer.presign_url(
32
41
  http_method: 'GET',
33
- url: 'https://sts.amazonaws.com/?Action=GetCallerIdentity&Version=2011-06-15',
42
+ url: "https://sts.#{region}.amazonaws.com/?Action=GetCallerIdentity&Version=2011-06-15",
34
43
  body: '',
35
44
  credentials: credentials,
36
45
  expires_in: 60,
@@ -1,4 +1,4 @@
1
1
  # Kubernetes REST-API Client
2
2
  module Kubeclient
3
- VERSION = '4.11.0'.freeze
3
+ VERSION = '4.12.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubeclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.0
4
+ version: 4.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alissa Bonas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2024-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  requirements: []
301
- rubygems_version: 3.2.32
301
+ rubygems_version: 3.4.20
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: A client for Kubernetes REST api