Compare commits

...

26 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
1f9d3b0fee
Merge pull request #2011 from yliaog/automated-release-of-26.1.0-upstream-release-26.0-1676440996
Some checks failed
End to End Tests - release-26.0 / build (3.7) (push) Has been cancelled
End to End Tests - release-26.0 / build (3.8) (push) Has been cancelled
End to End Tests - release-26.0 / build (3.9) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.10) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.11) (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 26.1.0 upstream release 26.0 1676440996
2023-02-15 11:14:21 -08:00
Yu Liao
332e1fb22c updated compatibility matrix and maintenance status 2023-02-15 06:07:39 +00:00
Yu Liao
a688be31b8 generated client change 2023-02-15 06:05:17 +00:00
Yu Liao
724375448c generated API change 2023-02-15 06:05:17 +00:00
Yu Liao
e758a219d8 update version constants for 26.1.0 release 2023-02-15 06:05:17 +00:00
Yu Liao
7e0967d6d4 update changelog with release notes from master branch 2023-02-15 06:05:17 +00:00
Yu Liao
9d741dda0a added release 1.26 e2e 2023-02-15 06:05:17 +00:00
Yu Liao
28b62fdb13 added 3.11 to the tests 2023-02-15 06:05:17 +00:00
Kubernetes Prow Robot
b37946f493
Merge pull request #2004 from yliaog/automated-release-of-26.1.0b1-upstream-release-26.0-1675142889
Automated release of 26.1.0b1 upstream release 26.0 1675142889
2023-01-31 12:36:50 -08:00
Yu Liao
31051947b6 updated compatibility matrix and maintenance status 2023-01-31 05:32:04 +00:00
Yu Liao
f3084ca40d generated client change 2023-01-31 05:30:32 +00:00
Yu Liao
b3f16a6e3f update version constants for 26.1.0b1 release 2023-01-31 05:30:32 +00:00
Yu Liao
dbedb76938 update changelog with release notes from master branch 2023-01-31 05:30:32 +00:00
Mostapha Sadeghipour Roudsari
50c764a43b Fix small misspelling error
handly -> handle
2023-01-31 05:30:32 +00:00
Tomasz Spyrka
5d1e254915 Convert timeout to ms when using poll method 2023-01-31 05:30:32 +00:00
Yu Liao
0855f76739 uploading to codecov failure does not fail the CI.
https://github.com/yliaog/client-python/actions/runs/4010290284/jobs/6886629356
2023-01-31 05:30:32 +00:00
Chandan Sharma
5d6725fa01 added newline at the end of code.
For better readability
2023-01-31 05:30:32 +00:00
Glenn Hinks
da99f0b712 doc: comment pod_exec.py for multiple containers
The behavior in kubectl is to run the exec command
against the default container. However, this needs to
be specified with the client call.

Add a comment in the example for this.
2023-01-31 05:30:32 +00:00
Venu Karnati
89a64de401 Creating Configmap with Request Timeout Setting
Updating README With Request Timeout Example

Updating Copyrights to 2023

Update timeout-settings.md
2023-01-31 05:30:32 +00:00
Kubernetes Prow Robot
4e84baa4ee
Merge pull request #1994 from yliaog/automated-release-of-26.1.0a1-upstream-release-26.0-1674599031
Automated release of 26.1.0a1 upstream release 26.0 1674599031
2023-01-25 11:08:02 -08:00
Yu Liao
784c4f72e1 Fixed issue: pass_env values cannot contain whitespace, use comma to have multiple
values in a single line

https://github.com/kubernetes-client/python/actions/runs/4001147429/jobs/6867090020
2023-01-24 23:09:18 +00:00
Yu Liao
692827f7ec updated compatibility matrix and maintenance status in README 2023-01-24 22:57:19 +00:00
Yu Liao
2a021b1c7b generated client change 2023-01-24 22:54:13 +00:00
Yu Liao
0174285b05 update changelog 2023-01-24 22:54:13 +00:00
Yu Liao
68e60b9690 update version constants for 26.1.0a1 release 2023-01-24 22:54:13 +00:00
Yu Liao
61eef1c5ea Removed 3.6 python version
https://github.com/kubernetes-client/python/actions/runs/3999583001/jobs/6863664535
2023-01-24 22:50:03 +00:00
22 changed files with 176 additions and 19 deletions

44
.github/workflows/e2e-release-26.0.yaml vendored Normal file
View File

@ -0,0 +1,44 @@
name: End to End Tests - release-26.0
on:
push:
branches:
- release-26.0
pull_request:
branches:
- release-26.0
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Create Kind Cluster
uses: helm/kind-action@v1.5.0
with:
cluster_name: kubernetes-python-e2e-release-26.0-${{ matrix.python-version }}
# The kind version to be used to spin the cluster up
# this needs to be updated whenever a new Kind version is released
version: v0.17.0
# Update the config here whenever a new client snapshot is performed
# This would eventually point to cluster with the latest Kubernetes version
# as we sync with Kubernetes upstream
config: .github/workflows/kind-configs/cluster-1.26.yaml
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r test-requirements.txt
- name: Install package
run: python -m pip install -e .
- name: Run End to End tests
run: pytest -vvv -s kubernetes/e2e_test

View File

@ -0,0 +1,7 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.26.0@sha256:3264cbae4b80c241743d12644b2506fff13dce07fcadf29079c1d06a47b399dd
- role: worker
image: kindest/node:v1.26.0@sha256:3264cbae4b80c241743d12644b2506fff13dce07fcadf29079c1d06a47b399dd

View File

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.10"]
python-version: ["3.7", "3.8", "3.10", "3.11"]
include:
- python-version: "3.9"
use_coverage: 'coverage'
@ -46,5 +46,5 @@ jobs:
if: "matrix.use_coverage"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
fail_ci_if_error: false
verbose: true

View File

@ -1,4 +1,24 @@
# v26.0.0-snapshot
# v26.1.0
Kubernetes API Version: v1.26.1
### Bug or Regression
- The timeout unit of the WSClient update method is now always seconds for both poll and select functions. (#1976, @t-yrka)
### Feature
- Adds support for loading CA certificates from a file using the `idp-certificate-authority` key for the oidc plugin. (#1916, @vgupta3)
# v26.1.0b1
Kubernetes API Version: v1.26.1
### Bug or Regression
- The timeout unit of the WSClient update method is now always seconds for both poll and select functions. (#1976, @t-yrka)
### Feature
- Adds support for loading CA certificates from a file using the `idp-certificate-authority` key for the oidc plugin. (#1916, @vgupta3)
# v26.1.0a1
Kubernetes API Version: v1.26.1

View File

@ -95,6 +95,7 @@ supported versions of Kubernetes clusters.
- [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 (+-)
- [client 26.y.z](https://pypi.org/project/kubernetes/26.1.0/): Kubernetes 1.25 or below (+-), Kubernetes 1.26 (✓), Kubernetes 1.27 or above (+-)
> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.
@ -144,11 +145,13 @@ between client-python versions.
| 22.0 Alpha/Beta | 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 | |
| 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 | ✓ |
| 26.0 Alpha/Beta | Kubernetes main repo, 1.26 branch | ✗ |
26.0 | Kubernetes main repo, 1.26 branch | ✓ |
> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.

View File

@ -40,4 +40,4 @@ def main():
if __name__ == "__main__":
main()
main()

View File

@ -0,0 +1,70 @@
# Copyright 2023 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This example demonstrates the following:
- Creation of a k8s configmap using dynamic-client
- Setting the request timeout which is time duration in seconds
"""
from kubernetes import config, dynamic
from kubernetes.client import api_client
def main():
# Creating a dynamic client
client = dynamic.DynamicClient(
api_client.ApiClient(configuration=config.load_kube_config())
)
# fetching the configmap api
api = client.resources.get(api_version="v1", kind="ConfigMap")
configmap_name = "request-timeout-test-configmap"
configmap_manifest = {
"kind": "ConfigMap",
"apiVersion": "v1",
"metadata": {
"name": configmap_name,
"labels": {
"foo": "bar",
},
},
"data": {
"config.json": '{"command":"/usr/bin/mysqld_safe"}',
"frontend.cnf": "[mysqld]\nbind-address = 10.0.0.3\n",
},
}
# Creating configmap `request-timeout-test-configmap` in the `default` namespace
# Client-side timeout to 60 seconds
configmap = api.create(body=configmap_manifest, namespace="default", _request_time=60)
print("\n[INFO] configmap `request-timeout-test-configmap` created\n")
# Listing the configmaps in the `default` namespace
# Client-side timeout to 60 seconds
configmap_list = api.get(
name=configmap_name, namespace="default", label_selector="foo=bar", _request_time=60
)
print("NAME:\n%s\n" % (configmap_list.metadata.name))
print("DATA:\n%s\n" % (configmap_list.data))
if __name__ == "__main__":
main()

View File

@ -71,6 +71,8 @@ def exec_commands(api_instance):
'/bin/sh',
'-c',
'echo This message goes to stderr; echo This message goes to stdout']
# When calling a pod with multiple containers running the target container
# has to be specified with a keyword argument container=<name>.
resp = stream(api_instance.connect_get_namespaced_pod_exec,
name,
'default',

View File

@ -56,6 +56,9 @@ There are two inputs available in the client, that could be used to set connecti
***Refer***
- *[https://github.com/kubernetes-client/python/blob/v17.17.0/kubernetes/client/api_client.py#L336-L339](https://github.com/kubernetes-client/python/blob/v17.17.0/kubernetes/client/api_client.py#L336-L339)*
***Example***
- *[request_timeout.py](../dynamic-client/request_timeout.py)*
- In case of network outage, leading to dropping all packets with no RST/FIN, the timeout value (in seconds) determined by the `request_timeout` argument, would be the time duration for how long the client will wait before dropping the connection.
- When the timeout happens, an exception will be raised, for eg. ~

View File

@ -1 +1 @@
ca8e42406994951820c2307a6f2ee6d6f4a846b5b46a6f4ebe5e28678d03d160
cee34aa4c662a6d749a5d924b37bf5e15218ca9ab8dbca9f629d51018fb9ba84

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.26
- Package version: 26.0.0-snapshot
- Package version: 26.1.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.

View File

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

View File

@ -182,6 +182,8 @@ class WSClient:
if hasattr(select, "poll"):
poll = select.poll()
poll.register(self.sock.sock, select.POLLIN)
if timeout is not None:
timeout *= 1_000 # poll method uses milliseconds as the time unit
r = poll.poll(timeout)
poll.unregister(self.sock.sock)
else:

View File

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

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/26.0.0-snapshot/python'
self.user_agent = 'OpenAPI-Generator/26.1.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.26\n"\
"SDK Package Version: 26.0.0-snapshot".\
"SDK Package Version: 26.1.0".\
format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self):

View File

@ -13136,7 +13136,10 @@
"$ref": "#/definitions/io.k8s.api.resource.v1alpha1.ResourceClaimConsumerReference"
},
"type": "array",
"x-kubernetes-list-type": "set"
"x-kubernetes-list-map-keys": [
"uid"
],
"x-kubernetes-list-type": "map"
}
},
"type": "object"

View File

@ -64,7 +64,7 @@ def parse_quantity(quantity):
else:
raise ValueError("{} has unknown suffix".format(quantity))
# handly SI inconsistency
# handle SI inconsistency
if suffix == "ki":
raise ValueError("{} has unknown suffix".format(quantity))

View File

@ -18,13 +18,13 @@ import sys
KUBERNETES_BRANCH = "release-1.26"
# client version for packaging and releasing.
CLIENT_VERSION = "26.0.0-snapshot"
CLIENT_VERSION = "26.1.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

@ -13208,7 +13208,10 @@
"$ref": "#/definitions/v1alpha1.ResourceClaimConsumerReference"
},
"type": "array",
"x-kubernetes-list-type": "set"
"x-kubernetes-list-map-keys": [
"uid"
],
"x-kubernetes-list-type": "map"
}
},
"type": "object"

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 = "26.0.0-snapshot"
CLIENT_VERSION = "26.1.0"
PACKAGE_NAME = "kubernetes"
DEVELOPMENT_STATUS = "3 - Alpha"
DEVELOPMENT_STATUS = "5 - Production/Stable"
# To install the library, run the following
#

View File

@ -4,7 +4,7 @@ envlist =
py3{6,7,8,9}-functional
[testenv]
passenv = TOXENV CI TRAVIS TRAVIS_*
passenv = TOXENV,CI,TRAVIS,TRAVIS_*
usedevelop = True
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt