8000 Merge pull request #1097 from palnabarun/release-11.0 · kubernetes-client/python@1dd9a4c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1dd9a4c

Browse files
authored
Merge pull request #1097 from palnabarun/release-11.0
Release 11.0
2 parents cc21670 + 6c90e47 commit 1dd9a4c

File tree

1,364 files changed

+1628
-1414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,364 files changed

+1628
-1414
lines changed

CHANGELOG.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
# v11.0.0
2+
3+
Kubernetes API Version: 1.15.10
4+
5+
**API Change:**
6+
7+
- Deleting CustomObjects doesn't require passing in the body anymore [kubernetes-client/gen#142](https://github.com/kubernetes-client/gen/pull/142)
8+
9+
**New Feature:**
10+
11+
- Add ability to the client to be used as Context Manager [kubernetes-client/python#1073](https://github.com/kubernetes-client/python/pull/1073)
12+
- Enable the use of dynamic client [kubernetes-client/python#1035](https://github.com/kubernetes-client/python/pull/1035)
13+
- Add option to refresh gcp token when config is cmd-path [kubernetes-client/python-base#175](https://github.com/kubernetes-client/python-base/pull/175)
14+
15+
**Bug Fix:**
16+
17+
- Add kubernetes.dynamic to setup.py pkg list[kubernetes-client/python#1096](https://github.com/kubernetes-client/python/pull/1096)
18+
- Fix custom object API example[kubernetes-client/python#1049](https://github.com/kubernetes-client/python/pull/1049)
19+
- Fix deprecation warning in E2E tests [kubernetes-client/python#1036](https://github.com/kubernetes-client/python/pull/1036)
20+
- Use `==/!=` to compare str, bytes, and int literals [kubernetes-client/python#1007](https://github.com/kubernetes-client/python/pull/1007)
21+
- Fix apiserver_id 'get' method [kubernetes-client/python-base#184](https://github.com/kubernetes-client/python-base/pull/184)
22+
- Fix persist_config flag and function calls [kubernetes-client/python-base#169](https://github.com/kubernetes-client/python-base/pull/169)
23+
- Fix memory inneficiencies in the WebSocket client [kubernetes-client/python-base#178](https://github.com/kubernetes-client/python-base/pull/178)
24+
- Fix functionality to watch logs when log line is not a JSON-serialized object [kubernetes-client/python-base#171](https://github.com/kubernetes-client/python-base/pull/171)
25+
- Detect binary payloads and send the correct opcode [kubernetes-client/python-base#152](https://github.com/kubernetes-client/python-base/pull/152)
26+
27+
**Deprecation Notice**
28+
v11.0.0 of the client follows the Kubernetes [deprecation policy](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/release/versioning.md#supported-releases-and-component-skew) and will
29+
be deprecated as and when Kubernetes version v1.15 gets deprecated.
30+
131
# v11.0.0b2
232
**Bug Fix:**
333
- Fix a fatal bug in package setup [kubernetes-client/python#1011](https://github.com/kubernetes-client/python/pull/1011)
@@ -44,6 +74,13 @@
4474
- Update `_load_azure_token` to handle str and int [kubernetes-client/python-base#141](https://github.com/kubernetes-client/python-base/pull/141)
4575
- Correct regex to properly parse rfc3339 microsecond 10000 s [kubernetes-client/python-base#150](https://github.com/kubernetes-client/python-base/pull/150)
4676

77+
# v10.0.1
78+
**Bug Fix:**
79+
- Fix content type regression in custom object patch API [kubernetes-client/python#866](https://github.com/kubernetes-client/python/issues/866)
80+
81+
**Security Fix:**
82+
- Bump urllib3 version to pick up security fix for CVE-2019-11324 [kubernetes-client/python#897](https://github.com/kubernetes-client/python/pull/897)
83+
4784
# v10.0.0
4885
**Bug Fix:**
4986
- Fix base64 padding for kube config [kubernetes-client/python-base#79](https://github.com/kubernetes-client/python-base/pull/79)
@@ -270,7 +307,7 @@
270307
- Restricting the websocket-client to <=0.40 #299
271308

272309
# v3.0.0a1
273-
- Update client to kubernetes 1.7
310+
- Update client to kubernetes 1.7
274311
- Support ThirdPartyResources (TPR) and CustomResourceDefinitions (CRD). Note that TPR is deprecated in kubernetes #251 #201
275312
- Better dependency management #136
276313
- Add support for python3.6 #244
@@ -325,7 +362,7 @@
325362

326363
# v1.0.0a3
327364

328-
- Add context switch to kube config loader #46
365+
- Add context switch to kube config loader #46
329366
- Add default kube config location #64
330367
- Add suport for accessing multiple clusters #7
331368
- Bugfix: Python client does not resolve relative paths in kubeconfig #68

CONTRIBUTING.md

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,77 @@ Please fill out either the individual or corporate Contributor License Agreement
1313

1414
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.
1515

16+
## Composition of This Repository and Where/How to Contribute
17+
18+
The Kubernetes Python client consists of this main repository (repo) and the base repo, the [python-base](https://github.com/kubernetes-client/python-base) repository. The main repository contains mostly files that are generated by the OpenAPI generator from [this OpenAPI spec](scripts/swagger.json). The base repo is the utility part of the python client and allows developers to create their own kubernetes clients. The base repo is a submodule of the main repo.
19+
20+
### Where to Submit Your Patch
21+
22+
The following folders are automatically generated. You will need to submit a patch to the upstream Kubernetes repo [kubernetes](https://github.com/kubernetes/kubernetes) or the OpenAPI generator repo [openapi-generator](https://github.com/OpenAPITools/openapi-generator).
23+
- [kubernetes/client](kubernetes/client)
24+
- [kubernetes/test](kubernetes/test)
25+
- [kubernetes/docs](kubernetes/docs).
26+
27+
In this main repo, the following folders contain developer written codes and the patches should be submitted as pull requests here:
28+
- [kubernetes/e2e_test](kubernetes/e2e_test)
29+
- [kubernetes/utils](kubernetes/utils)
30+
- [examples](examples)
31+
- [scripts](scripts).
32+
33+
The following folders and symbolic links in this main repo are in fact from the base repo. The base repo contains developer written codes only. The patches should be sent to the base repo instead:
34+
- kubernetes/base
35+
- kubernetes/config
36+
- kubernetes/stream
37+
- kubernetes/watch.
38+
1639
### Contributing A Patch
1740

1841
1. Submit an issue describing your proposed change to the repo in question.
19-
1. The [repo owners](OWNERS) will respond to your issue promptly.
20-
1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
21-
1. Fork the desired repo, develop and test your code changes.
22-
1. Submit a pull request.
42+
2. The [repo owners](OWNERS) will respond to your issue promptly.
43+
3. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
44+
4. Fork the desired repo, develop and test your code changes. Add a test if possible.
45+
5. Submit a pull request.
2346

2447
### Adding Dependencies
2548

26-
If your patch depends on new packages, add those packages to [requirements.txt](requirements.txt) and [setup.py](setup.py).
49+
If your patch depends on new packages, add those packages to [requirements.txt](requirements.txt) and/or [setup.py](setup.py). If these package are for testing only, add those to [test-requirements.txt](test-requirements.txt).
50+
51+
### Commits
52+
53+
Generally we would like to see one commit per pull request. However, if the pull request is reasonably large, the PR can be divided into several commits that make logical sense. The commit message should be clear and indicative of the aim of the fix. Sometimes multiple commits in a single pull request is acceptable if it meets the Kubernetes [pull request guidelines](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#6-squashing-and-commit-titles).
54+
55+
If you have several commits in a pull request and have been asked to squash your commits, please use ```git reset --soft HEAD~N_COMMITS``` and commit again to make your PR a single commit.
56+
57+
### Windows Developers
58+
59+
The symbolic links contained in this repo do not work for Windows operating systems. If you are a Windows developer, please run the [fix](scripts/windows-setup-fix.bat) inside the scripts folder or manually copy the content of the [kubernetes/base](https://github.com/kubernetes-client/python-base) folder into the [kubernetes](kubernetes) folder.
60+
61+
### Writing Tests
62+
63+
In addition to running the fix yourself and telling us that your fix works, you can demonstrate that your fix really works by using unit tests and end to end tests. Tests are mainly located in three places. You should put your tests into the places that they fit in.
64+
65+
1. [Generated tests](kubernetes/test) by OpenAPI generator: these tests should pass and do not require modification.
66+
2. [End to end tests](kubernetes/e2e_test): these are tests that can only be verified with a live kubernetes server.
67+
3. Base repo tests in the [base](https://github.com/kubernetes-client/python-base) repo, in which the test files are named ```test_*.py```: These tests use the package ```Mock``` and confirms the functionality of the base repo files.
68+
69+
### Coding Style
70+
71+
We use an automatic coding style checker by using the ```diff``` of the autopep8 output and your code file. To make sure that your code passes the coding style checker, run ```autopep8 --in-place --aggressive --aggressive your_code.py``` before committing and submitting.
72+
73+
## Running Tests Locally
74+
75+
If you write a new end to end (e2e) test, or change behaviors that affect e2e tests, you should set up a local cluster and test them on your machine. The following steps will help you run the unit tests.
76+
77+
1. Acquire a local cluster. [Minikube](https://github.com/kubernetes/minikube) is a good choice for Windows and Linux developers. Alternatively if you are on Linux, you can clone the [kubernetes](https://github.com/kubernetes/kubernetes) repo and run [install-etcd.sh](https://github.com/kubernetes/kubernetes/blob/master/hack/install-etcd.sh) and then [local-up-cluster.sh](https://github.com/kubernetes/kubernetes/blob/master/hack/local-up-cluster.sh) to get a local cluster up and running.
78+
79+
2. Run the unit tests. In the root directory of the main repo, run ```python -m unittest discover```.
80+
81+
3. Check the test results and make corresponding fixes.
82+
83+
## Update the Base Submodule in the Main Repo After Your python-base PR Is Merged
84+
85+
Your contribution to the base repo will not be automatically reflected in the main repo after your PR is merged. Instead, please update the ```base``` submodule in your fork of the main repo as follows:
86+
```bash
87+
$ git submodule update --remote
88+
```
89+
You may now add a release note to [CHANGELOG.md](CHANGELOG.md) if needed and then commit and push to your fork. You can now send a PR to this main repo to complete your contribution.

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,13 @@ between client-python versions.
114114
| 7.0 Alpha/Beta | Kubernetes main repo, 1.11 branch ||
115115
| 7.0 | Kubernetes main repo, 1.11 branch ||
116116
| 8.0 Alpha/Beta | Kubernetes main repo, 1.12 branch ||
117-
| 8.0 | Kubernetes main repo, 1.12 branch | |
117+
| 8.0 | Kubernetes main repo, 1.12 branch | |
118118
| 9.0 Alpha/Beta | Kubernetes main repo, 1.13 branch ||
119119
| 9.0 | Kubernetes main repo, 1.13 branch ||
120120
| 10.0 Alpha/Beta | Kubernetes main repo, 1.14 branch ||
121121
| 10.0 | Kubernetes main repo, 1.14 branch ||
122-
| 11.0 Alpha/Beta | Kubernetes main repo, 1.15 branch ||
122+
| 11.0 Alpha/Beta | Kubernetes main repo, 1.15 branch ||
123+
| 11.0 | Kubernetes main repo, 1.15 branch ||
123124

124125
Key:
125126

@@ -169,8 +170,8 @@ Specifically check `ipaddress` and `urllib3` package versions to make sure they
169170
Starting from 4.0 release, we do not support directly calling exec or attach calls. you should use stream module to call them. so instead
170171
of `resp = api.connect_get_namespaced_pod_exec(name, ...` you should call `resp = stream(api.connect_get_namespaced_pod_exec, name, ...`.
171172

172-
Using Stream will overwrite the requests protocol in _core_v1_api.CoreV1Api()_
173-
This will cause a failure in non-exec/attach calls. If you reuse your api client object, you will need to
173+
Using Stream will overwrite the requests protocol in _core_v1_api.CoreV1Api()_
174+
This will cause a failure in non-exec/attach calls. If you reuse your api client object, you will need to
174175
recreate it between api calls that use _stream_ and other api calls.
175-
176+
176177
See more at [exec example](examples/pod_exec.py).

devel/release.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ The release process of the python client involves creating (or updating) a relea
44
branch, updating release tags, and creating distribution packages and uploading them to
55
pypi.
66

7+
## Hot issues
8+
9+
There are some hot issues with the client generation that require manual fixes.
10+
***The steps in this section should be performed after you finished the section "Update release tags".***
11+
12+
1. Restore custom object patch hehavior. You should apply [this commit](https://github.com/kubernetes-client/python/pull/995/commits/9959273625b999ae9a8f0679c4def2ee7d699ede)
13+
to ensure custom object patch behavior is backwards compatible. For more
14+
details, see [#866](https://github.com/kubernetes-client/python/issues/866) and
15+
[#959](https://github.com/kubernetes-client/python/pull/959).
16+
17+
2. Add alias package kubernetes.client.apis with deprecation warning. You need
18+
to add [this file](https://github.com/kubernetes-client/python/blob/0976d59d6ff206f2f428cabc7a6b7b1144843b2a/kubernetes/client/apis/__init__.py)
19+
under `kubernetes/client/apis/` to ensure the package is backwards compatible.
20+
For more details, see [#974](https://github.com/kubernetes-client/python/issues/974)
21+
22+
Commit the manual changes like this [PR](https://github.com/kubernetes-client/python/pull/995/commits) does,
23+
then create your PR for review.
24+
725
## Change logs
826
Make sure the change logs are up to date [here](https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md).
927
If they are not, follow commits added after the last release and update/commit
@@ -85,6 +103,9 @@ scripts/update-client.sh
85103
and commit changes (should be only version number changes) to the release branch.
86104
Name the commit something like "Update version constants for XXX release".
87105

106+
***After you finished the steps above, refer to the section "Hot issues" and
107+
apply the manual fixes.***
108+
88109
```bash
89110
git push upstream $RELEASE_BRANCH
90111
```

examples/custom_object.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ def main():
5353
"apiVersion": "stable.example.com/v1",
5454
"kind": "CronTab",
5555
"metadata": {"name": "my-new-cron-object"},
56-
"cronSpec": "* * * * */5",
57-
"image": "my-awesome-cron-image",
56+
"spec": {
57+
"cronSpec": "* * * * */5",
58+
"image": "my-awesome-cron-image"
59+
}
5860
}
5961

6062
# create the resource

examples/deployment_crud.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ def main():
8282
# default location.
8383
config.load_kube_config()
8484
apps_v1 = client.AppsV1Api()
85+
86+
# Uncomment the following lines to enable debug logging
87+
# c = client.Configuration()
88+
# c.debug = True
89+
# apps_v1 = client.AppsV1Api(api_client=client.ApiClient(configuration=c))
90+
8591
# Create a deployment object with client-python API. The deployment we
8692
# created is same as the `nginx-deployment.yaml` in the /examples folder.
8793
deployment = create_deployment_object()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
577d087764c0f3898d73e8f4d8ae916a722ff68b638fb633f2d54992ebc35189
1+
cad1eb2da63fc749978bb21b6bfa374e535424f4f19456b815f7f95299c70db9

kubernetes/.swagger-codegen/COMMIT

Lines changed: 0 additions & 2 deletions
This file was deleted.

kubernetes/.swagger-codegen/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

kubernetes/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ No description provided (generated by Openapi Generator https://github.com/opena
33

44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

6-
- API version: v1.15.7
7-
- Package version: 11.0.0b2
6+
- API version: release-1.15
7+
- Package version: 11.0.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99

1010
## Requirements.

kubernetes/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414

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

1919
import kubernetes.client
2020
import kubernetes.config
21+
import kubernetes.dynamic
2122
import kubernetes.watch
2223
import kubernetes.stream
2324
import kubernetes.utils

kubernetes/client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
88
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
99
10-
OpenAPI spec version: v1.15.7
10+
OpenAPI spec version: release-1.15
1111
Generated by: https://openapi-generator.tech
1212
"""
1313

1414

1515
from __future__ import absolute_import
1616

17-
__version__ = "11.0.0b2"
17+
__version__ = "11.0.0"
1818

1919
# import apis into sdk package
2020
from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi

kubernetes/client/api/admissionregistration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/admissionregistration_v1beta1_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apiextensions_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apiextensions_v1beta1_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apiregistration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apiregistration_v1_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apiregistration_v1beta1_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apis_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apps_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apps_v1_api.py

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

66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77

8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

kubernetes/client/api/apps_v1beta1_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
8-
OpenAPI spec version: v1.15.7
8+
OpenAPI spec version: release-1.15
99
Generated by: https://openapi-generator.tech
1010
"""
1111

0 commit comments

Comments
 (0)
0