Skip to content
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

Release 11.0.0a1 #931

Merged
merged 12 commits into from
Sep 11, 2019

Conversation

roycaihw
Copy link
Member

Switching to openapi-generator + API changes in Kubernetes 1.15.

As planned in #926, we are going to do a 11.0.0a1 release with openapi-generator in the release branch. The master branch keeps using swagger-codegen for now. In 11.0.0b1 release we will switch the master branch to use openapi-generator.

Notes:

/assign @yliaog

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 15, 2019
@micw523
Copy link
Contributor

micw523 commented Aug 15, 2019

Do you mean 11.0.0a1?

@roycaihw roycaihw changed the title Release 10.0.0a1 Release 11.0.0a1 Aug 15, 2019
@@ -47,6 +47,13 @@ if [[ -z ${GEN_ROOT:-} ]]; then
GEN_ROOT="${TEMP_FOLDER}/gen"
echo ">>> Cloning gen repo"
git clone --recursive https://github.com/kubernetes-client/gen.git "${GEN_ROOT}"
# pick https://github.com/kubernetes-client/gen/pull/97
cd "${GEN_ROOT}"
git remote add tomplus https://github.com/tomplus/gen.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a personal repo. does openapi generator have an official repo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Roy is trying to pick the kubernetes-client/gen changes by tomplus

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not merge this kubernetes-client/gen#97 it first?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked with @yliaog offline. This is picking kubernetes-client/gen#97 into gen repo before we have it approved and merged. Timing-wise I can go with having this pick for the alpha release. For beta release we should definitely use upstream gen with kubernetes-client/gen#97 merged

CHANGELOG.md Outdated
- The Python client will be generated by openapi-generator, with the following breaking changes [kubernetes-client/gen#97](https://github.com/kubernetes-client/gen/pull/97)
- `kubernetes.client.apis` package is renamed to `kubernetes.client.api`
- `kubernetes` package code now uses absolute import instead of relative import
- API requests won't have `Content-Type` specified in HTTP headers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this not cause problem? we use json, or proto.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I interpreted the change wrong. The code generator just omitted the content type if the request doesn't have a body. I removed this note from the changelog since it's not user-facing.

@@ -17,9 +17,9 @@ Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github

```sh
pip install git+https://github.com/kubernetes-kubernetes.client/python.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it was not working before? what caused this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an old issue. Filed #952 to track the fix.

if headers['Content-Type'] == 'application/json-patch+json':
if not isinstance(body, list):
headers['Content-Type'] = \
'application/strategic-merge-patch+json'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this fix needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch is from https://github.com/kubernetes-client/python/blob/master/scripts/rest_client_patch.diff, which is a old hack for supporting strategic merge patch in the generated client.

This commit is needed, because the new code generator changed the generated client, and invalidates the old patch. I re-created the patch so the hack works again.

Filed #951 to track adding a test, which ensures strategic merge patch is always supported.

CHANGELOG.md Outdated Show resolved Hide resolved
kubernetes/README.md Outdated Show resolved Hide resolved
kubernetes/README.md Show resolved Hide resolved
@yliaog
Copy link
Contributor

yliaog commented Sep 11, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2019
@yliaog
Copy link
Contributor

yliaog commented Sep 11, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roycaihw, yliaog

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants