Merge pull request #1704 from yliaog/automated-release-of-22.6.0-upstream-release-22.0-1644864656
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
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 22.6.0 upstream release 22.0 1644864656
This commit is contained in:
commit
44453c3eab
2
.github/workflows/e2e-master.yaml
vendored
2
.github/workflows/e2e-master.yaml
vendored
@ -30,7 +30,7 @@ jobs:
|
||||
# as we sync with Kubernetes upstream
|
||||
config: .github/workflows/kind-configs/cluster-1.18.yaml
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2.3.1
|
||||
uses: actions/setup-python@v2.3.2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/e2e-release-11.0.yaml
vendored
2
.github/workflows/e2e-release-11.0.yaml
vendored
@ -30,7 +30,7 @@ jobs:
|
||||
# as we sync with Kubernetes upstream
|
||||
config: .github/workflows/kind-configs/cluster-1.15.yaml
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2.3.1
|
||||
uses: actions/setup-python@v2.3.2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/e2e-release-12.0.yaml
vendored
2
.github/workflows/e2e-release-12.0.yaml
vendored
@ -30,7 +30,7 @@ jobs:
|
||||
# as we sync with Kubernetes upstream
|
||||
config: .github/workflows/kind-configs/cluster-1.16.yaml
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2.3.1
|
||||
uses: actions/setup-python@v2.3.2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/e2e-release-17.0.yaml
vendored
2
.github/workflows/e2e-release-17.0.yaml
vendored
@ -30,7 +30,7 @@ jobs:
|
||||
# as we sync with Kubernetes upstream
|
||||
config: .github/workflows/kind-configs/cluster-1.17.yaml
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2.3.1
|
||||
uses: actions/setup-python@v2.3.2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
||||
2
.github/workflows/e2e-release-18.0.yaml
vendored
2
.github/workflows/e2e-release-18.0.yaml
vendored
@ -30,7 +30,7 @@ jobs:
|
||||
# as we sync with Kubernetes upstream
|
||||
config: .github/workflows/kind-configs/cluster-1.18.yaml
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2.3.1
|
||||
uses: actions/setup-python@v2.3.2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
|
||||
23
.github/workflows/test.yaml
vendored
23
.github/workflows/test.yaml
vendored
@ -4,18 +4,20 @@ on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.10"]
|
||||
include:
|
||||
- python-version: "3.9"
|
||||
use_coverage: 'coverage'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2.3.1
|
||||
uses: actions/setup-python@v2.3.2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
@ -31,5 +33,18 @@ jobs:
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Install Tox and any other packages
|
||||
run: pip install tox
|
||||
- name: Run Tox
|
||||
|
||||
- name: Test without coverage
|
||||
if: "! matrix.use_coverage"
|
||||
run: tox -e py # Run tox using the version of Python in `PATH`
|
||||
|
||||
- name: Test with coverage
|
||||
if: "matrix.use_coverage"
|
||||
run: tox -e py-coverage
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
if: "matrix.use_coverage"
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
|
||||
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,3 +1,13 @@
|
||||
# v22.6.0
|
||||
|
||||
Kubernetes API Version: v1.22.6
|
||||
|
||||
### Bug or Regression
|
||||
- Notable feature additions for async creation of Custom resources using dynamic Client (#1697, @venukarnati92)
|
||||
|
||||
### Feature
|
||||
- Add `utils.create_from_directory` for creating all yaml files in a directory (#1683, @dingyiyi0226)
|
||||
|
||||
# v22.6.0b1
|
||||
|
||||
Kubernetes API Version: v1.22.6
|
||||
|
||||
@ -138,7 +138,8 @@ between client-python versions.
|
||||
| 20.0 | Kubernetes main repo, 1.20 branch | ✓ |
|
||||
| 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 Alpha/Beta | Kubernetes main repo, 1.22 branch | ✗ |
|
||||
| 22.0 | Kubernetes main repo, 1.22 branch | ✓ |
|
||||
|
||||
> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.
|
||||
|
||||
|
||||
6
codecov.yml
Normal file
6
codecov.yml
Normal file
@ -0,0 +1,6 @@
|
||||
# reference: https://docs.codecov.io/docs/codecovyml-reference
|
||||
coverage:
|
||||
status:
|
||||
patch: true
|
||||
project: false
|
||||
comment: false
|
||||
@ -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.22
|
||||
- Package version: 22.6.0b1
|
||||
- Package version: 22.6.0
|
||||
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
||||
|
||||
## Requirements.
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
__project__ = 'kubernetes'
|
||||
# The version is auto-updated. Please do not edit.
|
||||
__version__ = "22.6.0b1"
|
||||
__version__ = "22.6.0"
|
||||
|
||||
import kubernetes.client
|
||||
import kubernetes.config
|
||||
|
||||
@ -267,7 +267,7 @@ class DynamicClient(object):
|
||||
# Authentication setting
|
||||
auth_settings = ['BearerToken']
|
||||
|
||||
return self.client.call_api(
|
||||
api_response = self.client.call_api(
|
||||
path,
|
||||
method.upper(),
|
||||
path_params,
|
||||
@ -281,6 +281,10 @@ class DynamicClient(object):
|
||||
_preload_content=False,
|
||||
_return_http_data_only=params.get('_return_http_data_only', True)
|
||||
)
|
||||
if params.get('async_req'):
|
||||
return api_response.get()
|
||||
else:
|
||||
return api_response
|
||||
|
||||
def validate(self, definition, version=None, strict=False):
|
||||
"""validate checks a kubernetes resource definition
|
||||
|
||||
@ -135,6 +135,121 @@ class TestDynamicClient(unittest.TestCase):
|
||||
changeme_api = client.resources.get(
|
||||
api_version='apps.example.com/v1', kind='ClusterChangeMe')
|
||||
|
||||
def test_async_namespaced_custom_resources(self):
|
||||
client = DynamicClient(api_client.ApiClient(configuration=self.config))
|
||||
|
||||
with self.assertRaises(ResourceNotFoundError):
|
||||
changeme_api = client.resources.get(
|
||||
api_version='apps.example.com/v1', kind='ChangeMe')
|
||||
|
||||
crd_api = client.resources.get(
|
||||
api_version='apiextensions.k8s.io/v1beta1',
|
||||
kind='CustomResourceDefinition')
|
||||
|
||||
name = 'changemes.apps.example.com'
|
||||
|
||||
crd_manifest = {
|
||||
'apiVersion': 'apiextensions.k8s.io/v1beta1',
|
||||
'kind': 'CustomResourceDefinition',
|
||||
'metadata': {
|
||||
'name': name,
|
||||
},
|
||||
'spec': {
|
||||
'group': 'apps.example.com',
|
||||
'names': {
|
||||
'kind': 'ChangeMe',
|
||||
'listKind': 'ChangeMeList',
|
||||
'plural': 'changemes',
|
||||
'singular': 'changeme',
|
||||
},
|
||||
'scope': 'Namespaced',
|
||||
'version': 'v1',
|
||||
'subresources': {
|
||||
'status': {}
|
||||
}
|
||||
}
|
||||
}
|
||||
async_resp = crd_api.create(crd_manifest, async_req=True)
|
||||
|
||||
self.assertEqual(name, async_resp.metadata.name)
|
||||
self.assertTrue(async_resp.status)
|
||||
|
||||
async_resp = crd_api.get(
|
||||
name=name,
|
||||
async_req=True
|
||||
)
|
||||
self.assertEqual(name, async_resp.metadata.name)
|
||||
self.assertTrue(async_resp.status)
|
||||
|
||||
try:
|
||||
changeme_api = client.resources.get(
|
||||
api_version='apps.example.com/v1', kind='ChangeMe')
|
||||
except ResourceNotFoundError:
|
||||
# Need to wait a sec for the discovery layer to get updated
|
||||
time.sleep(2)
|
||||
changeme_api = client.resources.get(
|
||||
api_version='apps.example.com/v1', kind='ChangeMe')
|
||||
|
||||
async_resp = changeme_api.get(async_req=True)
|
||||
self.assertEqual(async_resp.items, [])
|
||||
|
||||
changeme_name = 'custom-resource' + short_uuid()
|
||||
changeme_manifest = {
|
||||
'apiVersion': 'apps.example.com/v1',
|
||||
'kind': 'ChangeMe',
|
||||
'metadata': {
|
||||
'name': changeme_name,
|
||||
},
|
||||
'spec': {}
|
||||
}
|
||||
|
||||
async_resp = changeme_api.create(body=changeme_manifest, namespace='default', async_req=True)
|
||||
self.assertEqual(async_resp.metadata.name, changeme_name)
|
||||
|
||||
async_resp = changeme_api.get(name=changeme_name, namespace='default', async_req=True)
|
||||
self.assertEqual(async_resp.metadata.name, changeme_name)
|
||||
|
||||
changeme_manifest['spec']['size'] = 3
|
||||
async_resp = changeme_api.patch(
|
||||
body=changeme_manifest,
|
||||
namespace='default',
|
||||
content_type='application/merge-patch+json',
|
||||
async_req=True
|
||||
)
|
||||
self.assertEqual(async_resp.spec.size, 3)
|
||||
|
||||
async_resp = changeme_api.get(name=changeme_name, namespace='default', async_req=True)
|
||||
self.assertEqual(async_resp.spec.size, 3)
|
||||
|
||||
async_resp = changeme_api.get(namespace='default', async_req=True)
|
||||
self.assertEqual(len(async_resp.items), 1)
|
||||
|
||||
async_resp = changeme_api.get(async_req=True)
|
||||
self.assertEqual(len(async_resp.items), 1)
|
||||
|
||||
async_resp = changeme_api.delete(
|
||||
name=changeme_name,
|
||||
namespace='default',
|
||||
async_req=True
|
||||
)
|
||||
|
||||
async_resp = changeme_api.get(namespace='default', async_req=True)
|
||||
self.assertEqual(len(async_resp.items), 0)
|
||||
|
||||
async_resp = changeme_api.get(async_req=True)
|
||||
self.assertEqual(len(async_resp.items), 0)
|
||||
|
||||
async_resp = crd_api.delete(
|
||||
name=name,
|
||||
async_req=True
|
||||
)
|
||||
|
||||
time.sleep(2)
|
||||
client.resources.invalidate_cache()
|
||||
with self.assertRaises(ResourceNotFoundError):
|
||||
changeme_api = client.resources.get(
|
||||
api_version='apps.example.com/v1', kind='ChangeMe')
|
||||
|
||||
def test_namespaced_custom_resources(self):
|
||||
client = DynamicClient(api_client.ApiClient(configuration=self.config))
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
__version__ = "22.6.0b1"
|
||||
__version__ = "22.6.0"
|
||||
|
||||
# import apis into sdk package
|
||||
from kubernetes.client.api.well_known_api import WellKnownApi
|
||||
|
||||
@ -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/22.6.0b1/python'
|
||||
self.user_agent = 'OpenAPI-Generator/22.6.0/python'
|
||||
self.client_side_validation = configuration.client_side_validation
|
||||
|
||||
def __enter__(self):
|
||||
|
||||
@ -350,7 +350,7 @@ class Configuration(object):
|
||||
"OS: {env}\n"\
|
||||
"Python Version: {pyversion}\n"\
|
||||
"Version of the API: release-1.22\n"\
|
||||
"SDK Package Version: 22.6.0b1".\
|
||||
"SDK Package Version: 22.6.0".\
|
||||
format(env=sys.platform, pyversion=sys.version)
|
||||
|
||||
def get_host_settings(self):
|
||||
|
||||
@ -18,13 +18,13 @@ import sys
|
||||
KUBERNETES_BRANCH = "release-1.22"
|
||||
|
||||
# client version for packaging and releasing.
|
||||
CLIENT_VERSION = "22.6.0b1"
|
||||
CLIENT_VERSION = "22.6.0"
|
||||
|
||||
# Name of the release package
|
||||
PACKAGE_NAME = "kubernetes"
|
||||
|
||||
# Stage of development, mainly used in setup.py's classifiers.
|
||||
DEVELOPMENT_STATUS = "4 - Beta"
|
||||
DEVELOPMENT_STATUS = "5 - Production/Stable"
|
||||
|
||||
|
||||
# If called directly, return the constant value given
|
||||
|
||||
4
setup.py
4
setup.py
@ -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 = "22.6.0b1"
|
||||
CLIENT_VERSION = "22.6.0"
|
||||
PACKAGE_NAME = "kubernetes"
|
||||
DEVELOPMENT_STATUS = "4 - Beta"
|
||||
DEVELOPMENT_STATUS = "5 - Production/Stable"
|
||||
|
||||
# To install the library, run the following
|
||||
#
|
||||
|
||||
@ -9,7 +9,6 @@ mock>=2.0.0
|
||||
sphinx>=1.4 # BSD
|
||||
recommonmark
|
||||
sphinx_markdown_tables
|
||||
codecov>=1.4.0
|
||||
pycodestyle
|
||||
autopep8
|
||||
isort
|
||||
|
||||
14
tox.ini
14
tox.ini
@ -11,8 +11,11 @@ deps = -r{toxinidir}/test-requirements.txt
|
||||
-r{toxinidir}/requirements.txt
|
||||
commands =
|
||||
python -V
|
||||
!functional: pytest -vvv -s --ignore=kubernetes/e2e_test
|
||||
!functional: pytest -vvv -s {env:_TOX_COVERAGE_RUN:} --ignore=kubernetes/e2e_test
|
||||
functional: {toxinidir}/scripts/kube-init.sh pytest -vvv -s []
|
||||
coverage: python -m coverage xml
|
||||
setenv =
|
||||
coverage: _TOX_COVERAGE_RUN=--cov=kubernetes/watch --cov=kubernetes/config
|
||||
|
||||
[testenv:docs]
|
||||
commands =
|
||||
@ -21,12 +24,3 @@ commands =
|
||||
[testenv:update-pycodestyle]
|
||||
commands =
|
||||
{toxinidir}/scripts/update-pycodestyle.sh
|
||||
|
||||
[testenv:coverage]
|
||||
commands =
|
||||
python -V
|
||||
pytest --cov=kubernetes/watch --cov=kubernetes/config kubernetes/watch kubernetes/config
|
||||
|
||||
[testenv:codecov]
|
||||
commands =
|
||||
codecov
|
||||
|
||||
Loading…
Reference in New Issue
Block a user