Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pull master into release-17.0 #1447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
213cd83
Add Python 3.9 to build
gliptak Nov 10, 2020
d035588
Clarify support cycles for the releases temporarily
palnabarun Nov 13, 2020
cf3dc14
Refactor the format of compatibitility matrix
palnabarun Nov 13, 2020
3890d6d
Add v17.14.0a1 to the compatibility matrix
palnabarun Nov 16, 2020
f0dbe38
Add a note about the change in client versioning schema
palnabarun Nov 16, 2020
3ffa47e
Update CHANGELOG with v17.14.0a1
palnabarun Nov 13, 2020
eb9b6d6
Merge pull request #1321 from palnabarun/refactor-compat-and-support-…
k8s-ci-robot Nov 17, 2020
fd405e8
Implement back end raw port test container using python.
iciclespider Nov 22, 2020
49a59d7
Merge pull request #1329 from iciclespider/master
k8s-ci-robot Nov 23, 2020
f461dd4
Merge pull request #1311 from gliptak/python1
roycaihw Nov 24, 2020
d860dc5
Adding Power support(ppc64le) with ci and testing to the project for …
asellappen Dec 2, 2020
818e5ba
Merge pull request #1337 from asellappen/master
k8s-ci-robot Dec 4, 2020
5be9c89
update python-base submodule
roycaihw Jan 5, 2021
3b95adc
configmap-e2e: use labels
roycaihw Jan 5, 2021
9093103
pod e2e: wait for the default service account to be created
roycaihw Jan 11, 2021
3e615b6
Merge pull request #1348 from roycaihw/configmap-e2e/labels
k8s-ci-robot Jan 13, 2021
bd26d85
Enable leaderelection
Invictus17 Jan 28, 2021
6eb9f7d
Adding module leaderelection from base
Invictus17 Feb 1, 2021
a6655d6
Adding symbolic link to base/leaderelection
Invictus17 Feb 5, 2021
cbc2a2d
Merge pull request #1363 from Invictus17/master
k8s-ci-robot Feb 5, 2021
d7584c5
Added kubernetes.leaderelection in packages list to fix No module nam…
soumitrak Feb 5, 2021
529bae3
Merge pull request #1370 from soumitrak/master
k8s-ci-robot Feb 6, 2021
fdd2e14
Update base submodule
chrisayoub Feb 25, 2021
2febc69
Merge pull request #1383 from chrisayoub/master
k8s-ci-robot Feb 26, 2021
9a0713b
Fix Typo in examples/remote_cluster.py
jonasdlindner Mar 1, 2021
f17076f
Merge pull request #1385 from jonasdlindner/master
k8s-ci-robot Mar 2, 2021
44fe8bf
Refactor utils
abhiabhi94 Mar 10, 2021
bf63f59
Merge pull request #1390 from abhiabhi94/ref/utils
k8s-ci-robot Mar 14, 2021
b3e51c4
examples/pod_exec.py: fix example
Akasurde Mar 23, 2021
b839eee
Merge pull request #1401 from Akasurde/i1396
k8s-ci-robot Mar 30, 2021
b78db01
Bump actions/setup-python from v2.1.4 to v2.2.2
dependabot[bot] Apr 13, 2021
b313b5e
Merge pull request #1416 from kubernetes-client/dependabot/github_act…
k8s-ci-robot Apr 13, 2021
7b9e77b
add update-submodule script
roycaihw Apr 20, 2021
d86a47d
add PR template
roycaihw Apr 20, 2021
83d294e
fixup! add update-submodule script
roycaihw Apr 20, 2021
683ea36
Merge pull request #1419 from roycaihw/release-automation
k8s-ci-robot Apr 21, 2021
c3005ce
Merge pull request #1322 from palnabarun/update-CHANGELOG
k8s-ci-robot Apr 22, 2021
7309a45
configure the openapi-generator version
roycaihw Apr 26, 2021
e2aad06
Merge pull request #1431 from roycaihw/pin-openapi-generator
k8s-ci-robot Apr 26, 2021
68aeb30
Fix CRD manifest yaml
Priyankasaggu11929 Apr 27, 2021
0e37654
simplify & enhance the node_labels.py example
Priyankasaggu11929 Apr 27, 2021
adac2e0
improve comments
Priyankasaggu11929 Apr 27, 2021
b5fedc3
Merge pull request #1433 from Priyankasaggu11929/psaggufix_crd_yaml_m…
k8s-ci-robot Apr 27, 2021
41d331f
fix whitespaces
Priyankasaggu11929 Apr 28, 2021
b5d41cb
fix whitspaces
Priyankasaggu11929 Apr 28, 2021
fca1765
Create cluster_scoped_custom_object.py
Priyankasaggu11929 Apr 28, 2021
60e8c89
Update node_labels.py
Priyankasaggu11929 Apr 28, 2021
3b54f4c
Update cluster_scoped_custom_object.py
Priyankasaggu11929 Apr 28, 2021
cc66bc1
correct copyright year to 2021
Priyankasaggu11929 Apr 28, 2021
af4ea4b
add more log messages
Priyankasaggu11929 Apr 28, 2021
c3f1a1c
Merge pull request #1435 from Priyankasaggu11929/psaggu-enhance_node_…
k8s-ci-robot Apr 28, 2021
f7a4ad9
correct `custom object` to `custom resource (CR)`
Priyankasaggu11929 Apr 28, 2021
0ea3542
Merge pull request #1437 from Priyankasaggu11929/psaggu_add_cluster_s…
k8s-ci-robot Apr 28, 2021
684544e
detect OS X sed and fail client generation script
roycaihw Apr 29, 2021
9182d09
apply-hotfixes: use commits from upstream repo instead of a forked repo
roycaihw Apr 29, 2021
57d74ae
Merge pull request #1441 from roycaihw/detect-os-x-sed
k8s-ci-robot Apr 29, 2021
67f9c7a
examples: comment improvement in remote_cluster.py and deployment_cre…
jonasdlindner Apr 29, 2021
829d8a0
Merge pull request #1443 from roycaihw/hotfixes-use-upstream-commits
k8s-ci-robot Apr 29, 2021
9248a90
Removed the custom_object.py file and and added namespaced_custom_obj…
Yashks1994 Apr 29, 2021
36d2108
Merge pull request #1440 from Yashks1994/remove-custom-patch1
k8s-ci-robot Apr 30, 2021
66a6654
Merge pull request #1442 from jonasdlindner/master
k8s-ci-robot Apr 30, 2021
b181532
Merge branch 'master' of github.com:kubernetes-client/python into pul…
roycaihw Apr 30, 2021
b53d54f
changelog for pulling master and corresponding submodule changes
roycaihw Apr 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!-- Thanks for sending a pull request! Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
5. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

#### What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind design

Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".

For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->
```release-note

```

#### Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

<!--
This section can be blank if this pull request does not require a release note.

When adding links which point to resources within git repositories, like
KEPs or supporting documentation, please reference a specific commit and avoid
linking directly to the master branch. This ensures that links reference a
specific point in time, rather than a document that may change over time.

See here for guidance on getting permanent links to files: https://help.github.com/en/articles/getting-permanent-links-to-files

Please use the following format for linking documentation:
- [KEP]: <link>
- [Usage]: <link>
- [Other doc]: <link>
-->
```docs

```
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
54 changes: 53 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: python
dist: xenial
dist: bionic
services:
- docker

Expand All @@ -13,9 +13,16 @@ jobs:
include:
- stage: verify-tag
python: 3.7
arch: ppc64le
script: >
[ "v$(python -c 'from scripts.constants import CLIENT_VERSION; print(CLIENT_VERSION)')" == "${TRAVIS_TAG}" ] &&
[[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(([ab]|dev|rc)[0-9]+)?$ ]]
- stage: verify-tag
python: 3.7
script: >
[ "v$(python -c 'from scripts.constants import CLIENT_VERSION; print(CLIENT_VERSION)')" == "${TRAVIS_TAG}" ] &&
[[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(([ab]|dev|rc)[0-9]+)?$ ]]

- stage: test
python: 2.7
env: TOXENV=update-pycodestyle
Expand Down Expand Up @@ -43,8 +50,53 @@ jobs:
env: TOXENV=py38
- python: 3.8
env: TOXENV=py38-functional
- python: 3.9
env: TOXENV=py39
- python: 3.9
env: TOXENV=py39-functional
- stage: deploy
script: skip
deploy:
provider: pypi
user: __token__
password:
secure: gY5Rixj7mWHC9XP5qV5DfWGdX4ZVwCEUElnQA2OeIg235I3eMBqRFM4Q/SKwAG2DzgIWNKsXXVQsZHp7BAjWFMFVQloiU7zohuBRToJUim9U1RaqAjUIr4OU7JPtXenAl5zyyBdywvJiG8UZ4wmt1DBYtdpozQvOwDXvOxNTmElKh5mfDhiSsipmFr2198NtIhiRVC+CZliZsi6osUkt+G6yl9CW+SJU3otgzdaS+VBP26HO0kWHMJiDKvQoIl/Q50IqJUWieFhCLh7lSV71VNVEmM4bMcYK8cAv3zMZHo6REKHF7xrF5tzYMXqpmEGt6L798d2H4BISr6BIlYgiYCatjyE9hxih9iBzGs0XaGUUFD8u1iuzOQI76a5dapG/DixQrGD2o9Gn/Qw6Zp9USIuKZSWUn5hSobwxJUKVNy+afpaJNQUb2W9Hj+jMXAnBDodCzo3nu+QF8GN72cmk3uqVyKUVABtI4kNe3qcEx3DyKfoh7aqJrgydeaRwESKuZ41l5CA+vqXSbbNW8z1MYDYgVdwEyRFsLg6aQk5pPsxuiILaaGy13TUndhuC+GuKcW6wCDf6WpUAwwGAF8+sz4hZ1pfSUdE3F8nfDBW3Bv+G9cB/cKkWJ2vOd9httRrvir8qUc/xPP5aW4pacnfNCQ04Iep/k4PCAdYJDtVGhCY=
skip_existing: true
on:
tags: true
repo: kubernetes-client/python
distributions: sdist bdist_wheel

- stage: test
python: 2.7
env: TOXENV=update-pycodestyle
arch: ppc64le
- python: 3.7
env: TOXENV=docs
arch: ppc64le
- python: 2.7
env: TOXENV=coverage,codecov
arch: ppc64le
- python: 2.7
env: TOXENV=py27
arch: ppc64le
- python: 3.5
env: TOXENV=py35
arch: ppc64le
- python: 3.6
env: TOXENV=py36
arch: ppc64le
- python: 3.7
env: TOXENV=py37
arch: ppc64le
- python: 3.8
env: TOXENV=py38
- python: 3.9
env: TOXENV=py39
arch: ppc64le
- stage: deploy
script: skip
arch: ppc64le
deploy:
provider: pypi
user: __token__
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# v17.17.0b1

Kubernetes API Version: 1.17.17

Changelog since v17.14.0a1:

**New Feature:**
- Add Python 3.9 to build [kubernetes-client/python#1311](https://github.com/kubernetes-client/python/pull/1311)
- Enable leaderelection [kubernetes-client/python#1363](https://github.com/kubernetes-client/python/pull/1363)

**Bug Fix:**
- fix: load cache error when CacheDecoder object is not callable [kubernetes-client/python-base#226](https://github.com/kubernetes-client/python-base/pull/226)
- raise exception when an empty config file is passed to load_kube_config [kubernetes-client/python-base#223](https://github.com/kubernetes-client/python-base/pull/223)
- Fix bug with Watch and 410 retries [kubernetes-client/python-base#227](https://github.com/kubernetes-client/python-base/pull/227)

# v17.14.0a1

Kubernetes API Version: 1.17.14
Expand Down
4 changes: 2 additions & 2 deletions devel/submodules.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ git submodule update --init
If you changed [kubernetes-client/python-base](https://github.com/kubernetes-client/python-base) and want to pull your changes into this repo run this command:

```bash
git submodule update --remote
scripts/update-submodule.sh
```

Once updated, you should create a new PR to commit changes to the repository.
After the script finishes, please create a commit "generated python-base update" and send a PR to this repository.
150 changes: 150 additions & 0 deletions examples/cluster_scoped_custom_object.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Copyright 2021 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.

"""
Uses a Custom Resource Definition (CRD) to create a Custom Resource (CR), in this case
a CronTab. This example use an example CRD from this tutorial:
https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/

Apply the following yaml manifest to create a cluster-scoped CustomResourceDefinition (CRD)

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
image:
type: string
replicas:
type: integer
scope: Cluster
names:
plural: crontabs
singular: crontab
kind: CronTab
shortNames:
- ct
"""

from pprint import pprint

from kubernetes import client, config


def main():
config.load_kube_config()

api = client.CustomObjectsApi()

# definition of custom resource
test_resource = {
"apiVersion": "stable.example.com/v1",
"kind": "CronTab",
"metadata": {"name": "test-crontab"},
"spec": {"cronSpec": "* * * * */5", "image": "my-awesome-cron-image"},
}

# patch to update the `spec.cronSpec` field
cronspec_patch = {
"spec": {"cronSpec": "* * * * */15", "image": "my-awesome-cron-image"}
}

# patch to add the `metadata.labels` field
metadata_label_patch = {
"metadata": {
"labels": {
"foo": "bar",
}
}
}

# create a cluster scoped resource
created_resource = api.create_cluster_custom_object(
group="stable.example.com",
version="v1",
plural="crontabs",
body=test_resource,
)
print("[INFO] Custom resource `test-crontab` created!\n")

# get the cluster scoped resource
resource = api.get_cluster_custom_object(
group="stable.example.com",
version="v1",
name="test-crontab",
plural="crontabs",
)
print("%s\t\t%s" % ("NAME", "CRON-SPEC"))
print(
"%s\t%s\n" %
(resource["metadata"]["name"],
resource["spec"]["cronSpec"]))

# patch the `spec.cronSpec` field of the custom resource
patched_resource = api.patch_cluster_custom_object(
group="stable.example.com",
version="v1",
plural="crontabs",
name="test-crontab",
body=cronspec_patch,
)
print("[INFO] Custom resource `test-crontab` patched to update the cronSpec schedule!\n")
print("%s\t\t%s" % ("NAME", "PATCHED-CRON-SPEC"))
print(
"%s\t%s\n" %
(patched_resource["metadata"]["name"],
patched_resource["spec"]["cronSpec"]))

# patch the `metadata.labels` field of the custom resource
patched_resource = api.patch_cluster_custom_object(
group="stable.example.com",
version="v1",
plural="crontabs",
name="test-crontab",
body=metadata_label_patch,
)
print("[INFO] Custom resource `test-crontab` patched to apply new metadata labels!\n")
print("%s\t\t%s" % ("NAME", "PATCHED_LABELS"))
print(
"%s\t%s\n" %
(patched_resource["metadata"]["name"],
patched_resource["metadata"]["labels"]))

# delete the custom resource "test-crontab"
api.delete_cluster_custom_object(
group="stable.example.com",
version="v1",
name="test-crontab",
plural="crontabs",
body=client.V1DeleteOptions(),
)
print("[INFO] Custom resource `test-crontab` deleted!")


if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions examples/deployment_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Creates a deployment using AppsV1Api from file nginx-deployment.yaml.
"""

from os import path

import yaml
Expand Down
Loading