Compare commits

...

30 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
e884070240
Merge pull request #1937 from yliaog/automated-release-of-25.3.0-upstream-release-25.0-1666740937
Some checks failed
Kubernetes Python Client - Validation / build (3.10) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.6) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.7) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.8) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.9, coverage) (push) Has been cancelled
Automated release of 25.3.0 upstream release 25.0 1666740937
2022-10-25 16:50:34 -07:00
Yu Liao
03d2958a4c updated 25.3 release support matrix 2022-10-25 23:42:41 +00:00
Yu Liao
fd673fba50 generated client change 2022-10-25 23:38:53 +00:00
Yu Liao
90a9052f44 generated API change 2022-10-25 23:38:52 +00:00
Yu Liao
cef4c9ce46 generated client change for custom_objects 2022-10-25 23:38:52 +00:00
Yu Liao
ea36451601 update version constants for 25.3.0 release 2022-10-25 23:38:52 +00:00
Yu Liao
92ea48b80d update changelog with release notes from master branch 2022-10-25 23:38:52 +00:00
Kubernetes Prow Robot
73b51ecb6d
Merge pull request #1931 from yliaog/automated-release-of-25.3.0b1-upstream-release-25.0-1666286324
Automated release of 25.3.0b1 upstream release 25.0 1666286324
2022-10-20 10:33:00 -07:00
Yu Liao
c91762fdfa updated compatibility matrix for 25.3.0b1 2022-10-20 17:21:37 +00:00
Yu Liao
1d5b9ecc12 generated client change 2022-10-20 17:19:35 +00:00
Yu Liao
b8acfab551 update version constants for 25.3.0b1 release 2022-10-20 17:19:35 +00:00
Yu Liao
4c6bc7ed2c update changelog with release notes from master branch 2022-10-20 17:19:35 +00:00
Kubernetes Prow Robot
77fab2bbd7
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
2022-10-20 09:59:01 -07:00
Yu Liao
4da537e3ab updated compatibility matrix for 25.2.0b1 2022-10-20 16:48:30 +00:00
Yu Liao
01941c3252 generated client change 2022-10-20 16:46:20 +00:00
Yu Liao
6d3860ac5f update version constants for 25.2.0b1 release 2022-10-20 16:46:20 +00:00
Yu Liao
5ec07d8ce8 update changelog with release notes from master branch 2022-10-20 16:46:20 +00:00
mans2singh
bfef7e4819 Updated example description 2022-10-20 16:46:20 +00:00
ram vikram singh
279c70b0a0 decoding a not safe url in load_kube_config
for issue #1911 fixing load_kube_config for decoding unsafe url token
2022-10-20 16:46:20 +00:00
Vibhor Gupta
afbe1713cf add testcases 2022-10-20 16:46:20 +00:00
Vibhor Gupta
15980fb0ca Add support for using oidc CA certificate file while refreshing token 2022-10-20 16:46:20 +00:00
mans2singh
0a6ca827a9 Updated example steps 2022-10-20 16:46:20 +00:00
Kubernetes Prow Robot
b814cf68d0
Merge pull request #1923 from yliaog/release-25.0
mock.call_args.kwargs was added after python 3.7, switched to the old…
2022-10-18 16:55:00 -07:00
Kubernetes Prow Robot
92a5cf7695
Merge pull request #1918 from yliaog/automated-release-of-25.2.0a1-upstream-release-25.0-1665521856
Automated release of 25.2.0a1 upstream release 25.0 1665521856
2022-10-13 11:19:01 -07:00
Yu Liao
2604b41432 mock.call_args.kwargs was added after python 3.7, switched to the old way to allow 3.7 and below pass 2022-10-13 18:10:35 +00:00
Yu Liao
3844f8e71c mock.call_args.kwargs was added after python 3.7, switched to the old way to allow 3.7 and below pass 2022-10-13 18:04:59 +00:00
Yu Liao
2f594d1718 updated compatiblity matrix for 1.25 alpha release. 2022-10-11 22:27:57 +00:00
Yu Liao
8634a641dc generated client change 2022-10-11 20:57:55 +00:00
Yu Liao
bbc8624cd2 update changelog 2022-10-11 20:57:38 +00:00
Yu Liao
e01c42e7e5 update version constants for 25.2.0a1 release 2022-10-11 20:57:38 +00:00
18 changed files with 332 additions and 16 deletions

View File

@ -1,4 +1,25 @@
# v25.0.0-snapshot
# v25.3.0
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.3.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.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

View File

@ -94,6 +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.3.0/): 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.
@ -141,11 +142,13 @@ between client-python versions.
| 21.0 Alpha/Beta | Kubernetes main repo, 1.21 branch | ✗ |
| 21.0 | Kubernetes main repo, 1.21 branch | ✗ |
| 22.0 Alpha/Beta | Kubernetes main repo, 1.22 branch | ✗ |
| 22.0 | Kubernetes main repo, 1.22 branch | |
| 22.0 | Kubernetes main repo, 1.22 branch | |
| 23.0 Alpha/Beta | Kubernetes main repo, 1.23 branch | ✗ |
| 23.0 | Kubernetes main repo, 1.23 branch | ✓ |
| 24.0 Alpha/Beta | Kubernetes main repo, 1.24 branch | ✗ |
| 24.0 | Kubernetes main repo, 1.24 branch | ✓ |
| 25.0 Alpha/Beta | Kubernetes main repo, 1.25 branch | ✗ |
| 25.0 | Kubernetes main repo, 1.25 branch | ✓ |
> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.

View File

@ -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
"""

View File

@ -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
"""

View File

@ -1 +1 @@
32d8e8aca85c7267307b37bf60cf99de68d8375371e641d975d111d1b17e2e8b
438073e9d3561c067c312a52fe1c1082abb45407757f52b79be344992edc2da6

View File

@ -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.0.0-snapshot
- Package version: 25.3.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
@ -491,6 +491,7 @@ Class | Method | HTTP request | Description
*CustomObjectsApi* | [**delete_collection_cluster_custom_object**](docs/CustomObjectsApi.md#delete_collection_cluster_custom_object) | **DELETE** /apis/{group}/{version}/{plural} |
*CustomObjectsApi* | [**delete_collection_namespaced_custom_object**](docs/CustomObjectsApi.md#delete_collection_namespaced_custom_object) | **DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural} |
*CustomObjectsApi* | [**delete_namespaced_custom_object**](docs/CustomObjectsApi.md#delete_namespaced_custom_object) | **DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} |
*CustomObjectsApi* | [**get_api_resources**](docs/CustomObjectsApi.md#get_api_resources) | **GET** /apis/{group}/{version} |
*CustomObjectsApi* | [**get_cluster_custom_object**](docs/CustomObjectsApi.md#get_cluster_custom_object) | **GET** /apis/{group}/{version}/{plural}/{name} |
*CustomObjectsApi* | [**get_cluster_custom_object_scale**](docs/CustomObjectsApi.md#get_cluster_custom_object_scale) | **GET** /apis/{group}/{version}/{plural}/{name}/scale |
*CustomObjectsApi* | [**get_cluster_custom_object_status**](docs/CustomObjectsApi.md#get_cluster_custom_object_status) | **GET** /apis/{group}/{version}/{plural}/{name}/status |

View File

@ -14,7 +14,7 @@
__project__ = 'kubernetes'
# The version is auto-updated. Please do not edit.
__version__ = "25.0.0-snapshot"
__version__ = "25.3.0"
import kubernetes.client
import kubernetes.config

View File

@ -147,7 +147,7 @@ class ExecProviderTest(unittest.TestCase):
instance.communicate.return_value = (self.output_ok, '')
ep = ExecProvider(self.input_ok, '/some/directory')
ep.run()
self.assertEqual(mock.call_args.kwargs['cwd'], '/some/directory')
self.assertEqual(mock.call_args[1]['cwd'], '/some/directory')
if __name__ == '__main__':

View File

@ -398,7 +398,7 @@ class KubeConfigLoader(object):
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(
@ -439,6 +439,9 @@ class KubeConfigLoader(object):
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

View File

@ -17,6 +17,7 @@ import datetime
import io
import json
import os
from pprint import pprint
import shutil
import tempfile
import unittest
@ -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": {
@ -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": {
@ -1059,6 +1084,33 @@ class TestKubeConfigLoader(BaseTestCase):
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(

View File

@ -14,7 +14,7 @@
from __future__ import absolute_import
__version__ = "25.0.0-snapshot"
__version__ = "25.3.0"
# import apis into sdk package
from kubernetes.client.api.well_known_api import WellKnownApi

View File

@ -1031,6 +1031,129 @@ class CustomObjectsApi(object):
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)
def get_api_resources(self, group, version, **kwargs): # noqa: E501
"""get_api_resources # noqa: E501
get available resources # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_resources(group, version, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
:param str group: The custom resource's group name (required)
:param str version: The custom resource's version (required)
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: V1APIResourceList
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
return self.get_api_resources_with_http_info(group, version, **kwargs) # noqa: E501
def get_api_resources_with_http_info(self, group, version, **kwargs): # noqa: E501
"""get_api_resources # noqa: E501
get available resources # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_resources_with_http_info(group, version, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
:param str group: The custom resource's group name (required)
:param str version: The custom resource's version (required)
:param _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict))
If the method is called asynchronously,
returns the request thread.
"""
local_var_params = locals()
all_params = [
'group',
'version'
]
all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout'
]
)
for key, val in six.iteritems(local_var_params['kwargs']):
if key not in all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_api_resources" % key
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'group' is set
if self.api_client.client_side_validation and ('group' not in local_var_params or # noqa: E501
local_var_params['group'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `group` when calling `get_api_resources`") # noqa: E501
# verify the required parameter 'version' is set
if self.api_client.client_side_validation and ('version' not in local_var_params or # noqa: E501
local_var_params['version'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `version` when calling `get_api_resources`") # noqa: E501
collection_formats = {}
path_params = {}
if 'group' in local_var_params:
path_params['group'] = local_var_params['group'] # noqa: E501
if 'version' in local_var_params:
path_params['version'] = local_var_params['version'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501
return self.api_client.call_api(
'/apis/{group}/{version}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1APIResourceList', # noqa: E501
auth_settings=auth_settings,
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)
def get_cluster_custom_object(self, group, version, plural, name, **kwargs): # noqa: E501
"""get_cluster_custom_object # noqa: E501

View File

@ -78,7 +78,7 @@ class ApiClient(object):
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/25.0.0-snapshot/python'
self.user_agent = 'OpenAPI-Generator/25.3.0/python'
self.client_side_validation = configuration.client_side_validation
def __enter__(self):

View File

@ -350,7 +350,7 @@ class Configuration(object):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: release-1.25\n"\
"SDK Package Version: 25.0.0-snapshot".\
"SDK Package Version: 25.3.0".\
format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self):

View File

@ -10,6 +10,7 @@ Method | HTTP request | Description
[**delete_collection_cluster_custom_object**](CustomObjectsApi.md#delete_collection_cluster_custom_object) | **DELETE** /apis/{group}/{version}/{plural} |
[**delete_collection_namespaced_custom_object**](CustomObjectsApi.md#delete_collection_namespaced_custom_object) | **DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural} |
[**delete_namespaced_custom_object**](CustomObjectsApi.md#delete_namespaced_custom_object) | **DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} |
[**get_api_resources**](CustomObjectsApi.md#get_api_resources) | **GET** /apis/{group}/{version} |
[**get_cluster_custom_object**](CustomObjectsApi.md#get_cluster_custom_object) | **GET** /apis/{group}/{version}/{plural}/{name} |
[**get_cluster_custom_object_scale**](CustomObjectsApi.md#get_cluster_custom_object_scale) | **GET** /apis/{group}/{version}/{plural}/{name}/scale |
[**get_cluster_custom_object_status**](CustomObjectsApi.md#get_cluster_custom_object_status) | **GET** /apis/{group}/{version}/{plural}/{name}/status |
@ -516,6 +517,73 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_api_resources**
> V1APIResourceList get_api_resources(group, version)
get available resources
### Example
* Api Key Authentication (BearerToken):
```python
from __future__ import print_function
import time
import kubernetes.client
from kubernetes.client.rest import ApiException
from pprint import pprint
configuration = kubernetes.client.Configuration()
# Configure API key authorization: BearerToken
configuration.api_key['authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Defining host is optional and default to http://localhost
configuration.host = "http://localhost"
# Enter a context with an instance of the API kubernetes.client
with kubernetes.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kubernetes.client.CustomObjectsApi(api_client)
group = 'group_example' # str | The custom resource's group name
version = 'version_example' # str | The custom resource's version
try:
api_response = api_instance.get_api_resources(group, version)
pprint(api_response)
except ApiException as e:
print("Exception when calling CustomObjectsApi->get_api_resources: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**group** | **str**| The custom resource's group name |
**version** | **str**| The custom resource's version |
### Return type
[**V1APIResourceList**](V1APIResourceList.md)
### Authorization
[BearerToken](../README.md#BearerToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**401** | Unauthorized | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_cluster_custom_object**
> object get_cluster_custom_object(group, version, plural, name)

View File

@ -18,13 +18,13 @@ import sys
KUBERNETES_BRANCH = "release-1.25"
# client version for packaging and releasing.
CLIENT_VERSION = "25.0.0-snapshot"
CLIENT_VERSION = "25.3.0"
# Name of the release package
PACKAGE_NAME = "kubernetes"
# Stage of development, mainly used in setup.py's classifiers.
DEVELOPMENT_STATUS = "3 - Alpha"
DEVELOPMENT_STATUS = "5 - Production/Stable"
# If called directly, return the constant value given

View File

@ -76815,6 +76815,51 @@
]
}
},
"/apis/{group}/{version}": {
"parameters": [
{
"name": "group",
"in": "path",
"required": true,
"description": "The custom resource's group name",
"type": "string"
},
{
"name": "version",
"in": "path",
"required": true,
"description": "The custom resource's version",
"type": "string"
}
],
"get": {
"operationId": "getAPIResources",
"description": "get available resources",
"tags": [
"custom_objects"
],
"consumes": [
"*/*"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.APIResourceList"
}
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/apis/{group}/{version}/{plural}": {
"parameters": [
{

View File

@ -16,9 +16,9 @@ from setuptools import setup
# Do not edit these constants. They will be updated automatically
# by scripts/update-client.sh.
CLIENT_VERSION = "25.0.0-snapshot"
CLIENT_VERSION = "25.3.0"
PACKAGE_NAME = "kubernetes"
DEVELOPMENT_STATUS = "3 - Alpha"
DEVELOPMENT_STATUS = "5 - Production/Stable"
# To install the library, run the following
#