Skip to content

Commit 77fab2b

Browse files
authored
Merge pull request #1930 from yliaog/automated-release-of-25.2.0b1-upstream-release-25.0-1666284251
Automated release of 25.2.0b1 upstream release 25.0 1666284251
2 parents b814cf6 + 4da537e commit 77fab2b

File tree

13 files changed

+75
-13
lines changed

13 files changed

+75
-13
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v25.2.0b1
2+
3+
Kubernetes API Version: v1.25.3
4+
5+
### Feature
6+
- Adds support for loading CA certificates from a file using the `idp-certificate-authority` key for the oidc plugin. (#1916, @vgupta3)
7+
18
# v25.2.0a1
29

310
Kubernetes API Version: v1.25.2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ supported versions of Kubernetes clusters.
9494
- [client 22.y.z](https://pypi.org/project/kubernetes/22.6.0/): Kubernetes 1.21 or below (+-), Kubernetes 1.22 (✓), Kubernetes 1.23 or above (+-)
9595
- [client 23.y.z](https://pypi.org/project/kubernetes/23.6.0/): Kubernetes 1.22 or below (+-), Kubernetes 1.23 (✓), Kubernetes 1.24 or above (+-)
9696
- [client 24.y.z](https://pypi.org/project/kubernetes/24.2.0/): Kubernetes 1.23 or below (+-), Kubernetes 1.24 (✓), Kubernetes 1.25 or above (+-)
97-
- [client 25.y.z](https://pypi.org/project/kubernetes/25.2.0a1/): Kubernetes 1.24 or below (+-), Kubernetes 1.25 (✓), Kubernetes 1.26 or above (+-)
97+
- [client 25.y.z](https://pypi.org/project/kubernetes/25.2.0b1/): Kubernetes 1.24 or below (+-), Kubernetes 1.25 (✓), Kubernetes 1.26 or above (+-)
9898

9999
> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.
100100

examples/node_labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
This example demonstrates the following:
1717
- Get a list of all the cluster nodes
1818
- Iterate through each node list item
19-
- Add or overwirite label "foo" with the value "bar"
19+
- Add or overwrite label "foo" with the value "bar"
2020
- Remove the label "baz"
2121
- Return the list of node with updated labels
2222
"""

examples/rollout-daemonset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This example covers the following:
33
- Create daemonset
44
- Update daemonset
5-
- List contoller revisions which belong to specified daemonset
5+
- List controller revisions which belong to specified daemonset
66
- Roll out daemonset
77
"""
88

kubernetes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

66
- API version: release-1.25
7-
- Package version: 25.2.0a1
7+
- Package version: 25.2.0b1
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99

1010
## Requirements.

kubernetes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
__project__ = 'kubernetes'
1616
# The version is auto-updated. Please do not edit.
17-
__version__ = "25.2.0a1"
17+
__version__ = "25.2.0b1"
1818

1919
import kubernetes.client
2020
import kubernetes.config

kubernetes/base/config/kube_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def _load_oid_token(self, provider):
398398

399399
if PY3:
400400
jwt_attributes = json.loads(
401-
base64.b64decode(parts[1] + padding).decode('utf-8')
401+
base64.urlsafe_b64decode(parts[1] + padding).decode('utf-8')
402402
)
403403
else:
404404
jwt_attributes = json.loads(
@@ -439,6 +439,9 @@ def _refresh_oidc(self, provider):
439439

440440
config.ssl_ca_cert = ca_cert.name
441441

442+
elif 'idp-certificate-authority' in provider['config']:
443+
config.ssl_ca_cert = provider['config']['idp-certificate-authority']
444+
442445
else:
443446
config.verify_ssl = False
444447

kubernetes/base/config/kube_config_test.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import io
1818
import json
1919
import os
20+
from pprint import pprint
2021
import shutil
2122
import tempfile
2223
import unittest
@@ -485,6 +486,13 @@ class TestKubeConfigLoader(BaseTestCase):
485486
"user": "expired_oidc"
486487
}
487488
},
489+
{
490+
"name": "expired_oidc_with_idp_ca_file",
491+
"context": {
492+
"cluster": "default",
493+
"user": "expired_oidc_with_idp_ca_file"
494+
}
495+
},
488496
{
489497
"name": "expired_oidc_nocert",
490498
"context": {
@@ -799,6 +807,23 @@ class TestKubeConfigLoader(BaseTestCase):
799807
}
800808
}
801809
},
810+
{
811+
"name": "expired_oidc_with_idp_ca_file",
812+
"user": {
813+
"auth-provider": {
814+
"name": "oidc",
815+
"config": {
816+
"client-id": "tectonic-kubectl",
817+
"client-secret": "FAKE_SECRET",
818+
"id-token": TEST_OIDC_EXPIRED_LOGIN,
819+
"idp-certificate-authority": TEST_CERTIFICATE_AUTH,
820+
"idp-issuer-url": "https://example.org/identity",
821+
"refresh-token":
822+
"lucWJjEhlxZW01cXI3YmVlcYnpxNGhzk"
823+
}
824+
}
825+
}
826+
},
802827
{
803828
"name": "expired_oidc_nocert",
804829
"user": {
@@ -1059,6 +1084,33 @@ def test_oidc_with_refresh(self, mock_ApiClient, mock_OAuth2Session):
10591084
self.assertTrue(loader._load_auth_provider_token())
10601085
self.assertEqual("Bearer abc123", loader.token)
10611086

1087+
@mock.patch('kubernetes.config.kube_config.OAuth2Session.refresh_token')
1088+
@mock.patch('kubernetes.config.kube_config.ApiClient.request')
1089+
def test_oidc_with_idp_ca_file_refresh(self, mock_ApiClient, mock_OAuth2Session):
1090+
mock_response = mock.MagicMock()
1091+
type(mock_response).status = mock.PropertyMock(
1092+
return_value=200
1093+
)
1094+
type(mock_response).data = mock.PropertyMock(
1095+
return_value=json.dumps({
1096+
"token_endpoint": "https://example.org/identity/token"
1097+
})
1098+
)
1099+
1100+
mock_ApiClient.return_value = mock_response
1101+
1102+
mock_OAuth2Session.return_value = {"id_token": "abc123",
1103+
"refresh_token": "newtoken123"}
1104+
1105+
loader = KubeConfigLoader(
1106+
config_dict=self.TEST_KUBE_CONFIG,
1107+
active_context="expired_oidc_with_idp_ca_file",
1108+
)
1109+
1110+
1111+
self.assertTrue(loader._load_auth_provider_token())
1112+
self.assertEqual("Bearer abc123", loader.token)
1113+
10621114
@mock.patch('kubernetes.config.kube_config.OAuth2Session.refresh_token')
10631115
@mock.patch('kubernetes.config.kube_config.ApiClient.request')
10641116
def test_oidc_with_refresh_nocert(

kubernetes/client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import absolute_import
1616

17-
__version__ = "25.2.0a1"
17+
__version__ = "25.2.0b1"
1818

1919
# import apis into sdk package
2020
from kubernetes.client.api.well_known_api import WellKnownApi

kubernetes/client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7878
self.default_headers[header_name] = header_value
7979
self.cookie = cookie
8080
# Set default User-Agent.
81-
self.user_agent = 'OpenAPI-Generator/25.2.0a1/python'
81+
self.user_agent = 'OpenAPI-Generator/25.2.0b1/python'
8282
self.client_side_validation = configuration.client_side_validation
8383

8484
def __enter__(self):

0 commit comments

Comments
 (0)