Skip to content

Commit

Permalink
Merge pull request #1930 from yliaog/automated-release-of-25.2.0b1-up…
Browse files Browse the repository at this point in the history
…stream-release-25.0-1666284251

Automated release of 25.2.0b1 upstream release 25.0 1666284251
  • Loading branch information
k8s-ci-robot committed Oct 20, 2022
2 parents b814cf6 + 4da537e commit 77fab2b
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
# v25.2.0b1

Kubernetes API Version: v1.25.3

### Feature
- Adds support for loading CA certificates from a file using the `idp-certificate-authority` key for the oidc plugin. (#1916, @vgupta3)

# v25.2.0a1

Kubernetes API Version: v1.25.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -94,7 +94,7 @@ supported versions of Kubernetes clusters.
- [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 (+-)
- [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 (+-)
- [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 (+-)
- [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 (+-)
- [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 (+-)

> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.
Expand Down
2 changes: 1 addition & 1 deletion examples/node_labels.py
Expand Up @@ -16,7 +16,7 @@
This example demonstrates the following:
- Get a list of all the cluster nodes
- Iterate through each node list item
- Add or overwirite label "foo" with the value "bar"
- Add or overwrite label "foo" with the value "bar"
- Remove the label "baz"
- Return the list of node with updated labels
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/rollout-daemonset.py
Expand Up @@ -2,7 +2,7 @@
This example covers the following:
- Create daemonset
- Update daemonset
- List contoller revisions which belong to specified daemonset
- List controller revisions which belong to specified daemonset
- Roll out daemonset
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/README.md
Expand Up @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: release-1.25
- Package version: 25.2.0a1
- Package version: 25.2.0b1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/__init__.py
Expand Up @@ -14,7 +14,7 @@

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

import kubernetes.client
import kubernetes.config
Expand Down
5 changes: 4 additions & 1 deletion kubernetes/base/config/kube_config.py
Expand Up @@ -398,7 +398,7 @@ def _load_oid_token(self, provider):

if PY3:
jwt_attributes = json.loads(
base64.b64decode(parts[1] + padding).decode('utf-8')
base64.urlsafe_b64decode(parts[1] + padding).decode('utf-8')
)
else:
jwt_attributes = json.loads(
Expand Down Expand Up @@ -439,6 +439,9 @@ def _refresh_oidc(self, provider):

config.ssl_ca_cert = ca_cert.name

elif 'idp-certificate-authority' in provider['config']:
config.ssl_ca_cert = provider['config']['idp-certificate-authority']

else:
config.verify_ssl = False

Expand Down
52 changes: 52 additions & 0 deletions kubernetes/base/config/kube_config_test.py
Expand Up @@ -17,6 +17,7 @@
import io
import json
import os
from pprint import pprint
import shutil
import tempfile
import unittest
Expand Down Expand Up @@ -485,6 +486,13 @@ class TestKubeConfigLoader(BaseTestCase):
"user": "expired_oidc"
}
},
{
"name": "expired_oidc_with_idp_ca_file",
"context": {
"cluster": "default",
"user": "expired_oidc_with_idp_ca_file"
}
},
{
"name": "expired_oidc_nocert",
"context": {
Expand Down Expand Up @@ -799,6 +807,23 @@ class TestKubeConfigLoader(BaseTestCase):
}
}
},
{
"name": "expired_oidc_with_idp_ca_file",
"user": {
"auth-provider": {
"name": "oidc",
"config": {
"client-id": "tectonic-kubectl",
"client-secret": "FAKE_SECRET",
"id-token": TEST_OIDC_EXPIRED_LOGIN,
"idp-certificate-authority": TEST_CERTIFICATE_AUTH,
"idp-issuer-url": "https://example.org/identity",
"refresh-token":
"lucWJjEhlxZW01cXI3YmVlcYnpxNGhzk"
}
}
}
},
{
"name": "expired_oidc_nocert",
"user": {
Expand Down Expand Up @@ -1059,6 +1084,33 @@ def test_oidc_with_refresh(self, mock_ApiClient, mock_OAuth2Session):
self.assertTrue(loader._load_auth_provider_token())
self.assertEqual("Bearer abc123", loader.token)

@mock.patch('kubernetes.config.kube_config.OAuth2Session.refresh_token')
@mock.patch('kubernetes.config.kube_config.ApiClient.request')
def test_oidc_with_idp_ca_file_refresh(self, mock_ApiClient, mock_OAuth2Session):
mock_response = mock.MagicMock()
type(mock_response).status = mock.PropertyMock(
return_value=200
)
type(mock_response).data = mock.PropertyMock(
return_value=json.dumps({
"token_endpoint": "https://example.org/identity/token"
})
)

mock_ApiClient.return_value = mock_response

mock_OAuth2Session.return_value = {"id_token": "abc123",
"refresh_token": "newtoken123"}

loader = KubeConfigLoader(
config_dict=self.TEST_KUBE_CONFIG,
active_context="expired_oidc_with_idp_ca_file",
)


self.assertTrue(loader._load_auth_provider_token())
self.assertEqual("Bearer abc123", loader.token)

@mock.patch('kubernetes.config.kube_config.OAuth2Session.refresh_token')
@mock.patch('kubernetes.config.kube_config.ApiClient.request')
def test_oidc_with_refresh_nocert(
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/__init__.py
Expand Up @@ -14,7 +14,7 @@

from __future__ import absolute_import

__version__ = "25.2.0a1"
__version__ = "25.2.0b1"

# import apis into sdk package
from kubernetes.client.api.well_known_api import WellKnownApi
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api_client.py
Expand Up @@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/25.2.0a1/python'
self.user_agent = 'OpenAPI-Generator/25.2.0b1/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/configuration.py
Expand Up @@ -350,7 +350,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: release-1.25\n"\
"SDK Package Version: 25.2.0a1".\
"SDK Package Version: 25.2.0b1".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
4 changes: 2 additions & 2 deletions scripts/constants.py
Expand Up @@ -18,13 +18,13 @@
KUBERNETES_BRANCH = "release-1.25"

# client version for packaging and releasing.
CLIENT_VERSION = "25.2.0a1"
CLIENT_VERSION = "25.2.0b1"

# Name of the release package
PACKAGE_NAME = "kubernetes"

# Stage of development, mainly used in setup.py's classifiers.
DEVELOPMENT_STATUS = "3 - Alpha"
DEVELOPMENT_STATUS = "4 - Beta"


# If called directly, return the constant value given
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -16,9 +16,9 @@

# Do not edit these constants. They will be updated automatically
# by scripts/update-client.sh.
CLIENT_VERSION = "25.2.0a1"
CLIENT_VERSION = "25.2.0b1"
PACKAGE_NAME = "kubernetes"
DEVELOPMENT_STATUS = "3 - Alpha"
DEVELOPMENT_STATUS = "4 - Beta"

# To install the library, run the following
#
Expand Down

0 comments on commit 77fab2b

Please sign in to comment.