Skip to content

Commit

Permalink
Merge pull request kubernetes-client#1097 from palnabarun/release-11.0
Browse files Browse the repository at this point in the history
Release 11.0
  • Loading branch information
k8s-ci-robot committed Mar 12, 2020
2 parents cc21670 + 6c90e47 commit 1dd9a4c
Show file tree
Hide file tree
Showing 1,364 changed files with 1,628 additions and 1,414 deletions.
41 changes: 39 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# v11.0.0

Kubernetes API Version: 1.15.10

**API Change:**

- Deleting CustomObjects doesn't require passing in the body anymore [kubernetes-client/gen#142](https://github.com/kubernetes-client/gen/pull/142)

**New Feature:**

- Add ability to the client to be used as Context Manager [kubernetes-client/python#1073](https://github.com/kubernetes-client/python/pull/1073)
- Enable the use of dynamic client [kubernetes-client/python#1035](https://github.com/kubernetes-client/python/pull/1035)
- 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)

**Bug Fix:**

- Add kubernetes.dynamic to setup.py pkg list[kubernetes-client/python#1096](https://github.com/kubernetes-client/python/pull/1096)
- Fix custom object API example[kubernetes-client/python#1049](https://github.com/kubernetes-client/python/pull/1049)
- Fix deprecation warning in E2E tests [kubernetes-client/python#1036](https://github.com/kubernetes-client/python/pull/1036)
- Use `==/!=` to compare str, bytes, and int literals [kubernetes-client/python#1007](https://github.com/kubernetes-client/python/pull/1007)
- Fix apiserver_id 'get' method [kubernetes-client/python-base#184](https://github.com/kubernetes-client/python-base/pull/184)
- Fix persist_config flag and function calls [kubernetes-client/python-base#169](https://github.com/kubernetes-client/python-base/pull/169)
- Fix memory inneficiencies in the WebSocket client [kubernetes-client/python-base#178](https://github.com/kubernetes-client/python-base/pull/178)
- 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)
- Detect binary payloads and send the correct opcode [kubernetes-client/python-base#152](https://github.com/kubernetes-client/python-base/pull/152)

**Deprecation Notice**
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
be deprecated as and when Kubernetes version v1.15 gets deprecated.

# v11.0.0b2
**Bug Fix:**
- Fix a fatal bug in package setup [kubernetes-client/python#1011](https://github.com/kubernetes-client/python/pull/1011)
Expand Down Expand Up @@ -44,6 +74,13 @@
- Update `_load_azure_token` to handle str and int [kubernetes-client/python-base#141](https://github.com/kubernetes-client/python-base/pull/141)
- Correct regex to properly parse rfc3339 microseconds [kubernetes-client/python-base#150](https://github.com/kubernetes-client/python-base/pull/150)

# v10.0.1
**Bug Fix:**
- Fix content type regression in custom object patch API [kubernetes-client/python#866](https://github.com/kubernetes-client/python/issues/866)

**Security Fix:**
- Bump urllib3 version to pick up security fix for CVE-2019-11324 [kubernetes-client/python#897](https://github.com/kubernetes-client/python/pull/897)

# v10.0.0
**Bug Fix:**
- Fix base64 padding for kube config [kubernetes-client/python-base#79](https://github.com/kubernetes-client/python-base/pull/79)
Expand Down Expand Up @@ -270,7 +307,7 @@
- Restricting the websocket-client to <=0.40 #299

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

# v1.0.0a3

- Add context switch to kube config loader #46
- Add context switch to kube config loader #46
- Add default kube config location #64
- Add suport for accessing multiple clusters #7
- Bugfix: Python client does not resolve relative paths in kubeconfig #68
Expand Down
73 changes: 68 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,77 @@ Please fill out either the individual or corporate Contributor License Agreement

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.

## Composition of This Repository and Where/How to Contribute

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.

### Where to Submit Your Patch

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).
- [kubernetes/client](kubernetes/client)
- [kubernetes/test](kubernetes/test)
- [kubernetes/docs](kubernetes/docs).

In this main repo, the following folders contain developer written codes and the patches should be submitted as pull requests here:
- [kubernetes/e2e_test](kubernetes/e2e_test)
- [kubernetes/utils](kubernetes/utils)
- [examples](examples)
- [scripts](scripts).

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:
- kubernetes/base
- kubernetes/config
- kubernetes/stream
- kubernetes/watch.

### Contributing A Patch

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

### Adding Dependencies

If your patch depends on new packages, add those packages to [requirements.txt](requirements.txt) and [setup.py](setup.py).
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).

### Commits

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).

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.

### Windows Developers

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.

### Writing Tests

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.

1. [Generated tests](kubernetes/test) by OpenAPI generator: these tests should pass and do not require modification.
2. [End to end tests](kubernetes/e2e_test): these are tests that can only be verified with a live kubernetes server.
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.

### Coding Style

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.

## Running Tests Locally

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.

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.

2. Run the unit tests. In the root directory of the main repo, run ```python -m unittest discover```.

3. Check the test results and make corresponding fixes.

## Update the Base Submodule in the Main Repo After Your python-base PR Is Merged

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:
```bash
$ git submodule update --remote
```
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.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ between client-python versions.
| 7.0 Alpha/Beta | Kubernetes main repo, 1.11 branch ||
| 7.0 | Kubernetes main repo, 1.11 branch ||
| 8.0 Alpha/Beta | Kubernetes main repo, 1.12 branch ||
| 8.0 | Kubernetes main repo, 1.12 branch | |
| 8.0 | Kubernetes main repo, 1.12 branch | |
| 9.0 Alpha/Beta | Kubernetes main repo, 1.13 branch ||
| 9.0 | Kubernetes main repo, 1.13 branch ||
| 10.0 Alpha/Beta | Kubernetes main repo, 1.14 branch ||
| 10.0 | Kubernetes main repo, 1.14 branch ||
| 11.0 Alpha/Beta | Kubernetes main repo, 1.15 branch ||
| 11.0 Alpha/Beta | Kubernetes main repo, 1.15 branch ||
| 11.0 | Kubernetes main repo, 1.15 branch ||

Key:

Expand Down Expand Up @@ -169,8 +170,8 @@ Specifically check `ipaddress` and `urllib3` package versions to make sure they
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
of `resp = api.connect_get_namespaced_pod_exec(name, ...` you should call `resp = stream(api.connect_get_namespaced_pod_exec, name, ...`.

Using Stream will overwrite the requests protocol in _core_v1_api.CoreV1Api()_
This will cause a failure in non-exec/attach calls. If you reuse your api client object, you will need to
Using Stream will overwrite the requests protocol in _core_v1_api.CoreV1Api()_
This will cause a failure in non-exec/attach calls. If you reuse your api client object, you will need to
recreate it between api calls that use _stream_ and other api calls.

See more at [exec example](examples/pod_exec.py).
21 changes: 21 additions & 0 deletions devel/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ The release process of the python client involves creating (or updating) a relea
branch, updating release tags, and creating distribution packages and uploading them to
pypi.

## Hot issues

There are some hot issues with the client generation that require manual fixes.
***The steps in this section should be performed after you finished the section "Update release tags".***

1. Restore custom object patch hehavior. You should apply [this commit](https://github.com/kubernetes-client/python/pull/995/commits/9959273625b999ae9a8f0679c4def2ee7d699ede)
to ensure custom object patch behavior is backwards compatible. For more
details, see [#866](https://github.com/kubernetes-client/python/issues/866) and
[#959](https://github.com/kubernetes-client/python/pull/959).

2. Add alias package kubernetes.client.apis with deprecation warning. You need
to add [this file](https://github.com/kubernetes-client/python/blob/0976d59d6ff206f2f428cabc7a6b7b1144843b2a/kubernetes/client/apis/__init__.py)
under `kubernetes/client/apis/` to ensure the package is backwards compatible.
For more details, see [#974](https://github.com/kubernetes-client/python/issues/974)

Commit the manual changes like this [PR](https://github.com/kubernetes-client/python/pull/995/commits) does,
then create your PR for review.

## Change logs
Make sure the change logs are up to date [here](https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md).
If they are not, follow commits added after the last release and update/commit
Expand Down Expand Up @@ -85,6 +103,9 @@ scripts/update-client.sh
and commit changes (should be only version number changes) to the release branch.
Name the commit something like "Update version constants for XXX release".

***After you finished the steps above, refer to the section "Hot issues" and
apply the manual fixes.***

```bash
git push upstream $RELEASE_BRANCH
```
Expand Down
6 changes: 4 additions & 2 deletions examples/custom_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ def main():
"apiVersion": "stable.example.com/v1",
"kind": "CronTab",
"metadata": {"name": "my-new-cron-object"},
"cronSpec": "* * * * */5",
"image": "my-awesome-cron-image",
"spec": {
"cronSpec": "* * * * */5",
"image": "my-awesome-cron-image"
}
}

# create the resource
Expand Down
6 changes: 6 additions & 0 deletions examples/deployment_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def main():
# default location.
config.load_kube_config()
apps_v1 = client.AppsV1Api()

# Uncomment the following lines to enable debug logging
# c = client.Configuration()
# c.debug = True
# apps_v1 = client.AppsV1Api(api_client=client.ApiClient(configuration=c))

# Create a deployment object with client-python API. The deployment we
# created is same as the `nginx-deployment.yaml` in the /examples folder.
deployment = create_deployment_object()
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/.openapi-generator/swagger.json.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
577d087764c0f3898d73e8f4d8ae916a722ff68b638fb633f2d54992ebc35189
cad1eb2da63fc749978bb21b6bfa374e535424f4f19456b815f7f95299c70db9
2 changes: 0 additions & 2 deletions kubernetes/.swagger-codegen/COMMIT

This file was deleted.

1 change: 0 additions & 1 deletion kubernetes/.swagger-codegen/VERSION

This file was deleted.

4 changes: 2 additions & 2 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ 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: v1.15.7
- Package version: 11.0.0b2
- API version: release-1.15
- Package version: 11.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
3 changes: 2 additions & 1 deletion kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

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

import kubernetes.client
import kubernetes.config
import kubernetes.dynamic
import kubernetes.watch
import kubernetes.stream
import kubernetes.utils
2 changes: 1 addition & 1 deletion kubernetes/base
4 changes: 2 additions & 2 deletions kubernetes/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

__version__ = "11.0.0b2"
__version__ = "11.0.0"

# import apis into sdk package
from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/admissionregistration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/admissionregistration_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apiextensions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apiextensions_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apiregistration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apiregistration_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apiregistration_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apis_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apps_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apps_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api/apps_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""

Expand Down
Loading

0 comments on commit 1dd9a4c

Please sign in to comment.