-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[WIP] feat: client generated by openapi-generator #738
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tomplus If they are not already assigned, you can assign the PR to them by writing 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 |
@@ -0,0 +1,2 @@ | |||
Requested Commit: v3.3.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubernete/.swagger-codegen
is deleted, openapi-generator uses kubernetes/.openapi-generator
and also .openapi-generator-ignore
instead of .swagger-codegen-ignore
(renamed).
|
||
# flake8: noqa | ||
|
||
# import apis into api package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This packages is renamed from apis to api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why did you change it from apis to api?
@@ -56,7 +56,7 @@ | |||
tests_require=TESTS_REQUIRES, | |||
extras_require=EXTRAS, | |||
packages=['kubernetes', 'kubernetes.client', 'kubernetes.config', | |||
'kubernetes.watch', 'kubernetes.client.apis', | |||
'kubernetes.watch', 'kubernetes.client.api', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apis -> api
@@ -16,7 +16,7 @@ | |||
import uuid | |||
|
|||
from kubernetes.client import api_client | |||
from kubernetes.client.apis import batch_v1_api | |||
from kubernetes.client.api import batch_v1_api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apis -> api
here and in another e2e tests too.
--- a/kubernetes/client/rest.py | ||
+++ b/kubernetes/client/rest.py | ||
@@ -152,6 +152,10 @@ class RESTClientObject(object): | ||
@@ -155,6 +155,10 @@ class RESTClientObject(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to be updated to apply this patch by update_client.sh
""" | ||
|
||
|
||
from __future__ import absolute_import | ||
|
||
# import models into sdk package | ||
from .models.admissionregistration_v1beta1_service_reference import AdmissionregistrationV1beta1ServiceReference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relative vs. absolute imports
import sys | ||
import os | ||
import re | ||
import re # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of changes which clean the code (unused imports, long lines etc.).
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
/cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty neat. I checked the apis and the models. It seems that the only major interface change is the package getting renamed.
was there any file contributed a lot to the line number diff (9620 from +93,422 −103,042)? I didn't see huge file getting deleted. It's probably accumulated as we cut a couple of lines from the hundreds of files.
I re-triggered the tests and the test failure looks unrelated-- more like server-side problem than client-side
@@ -0,0 +1,2 @@ | |||
Requested Commit: v3.3.4 | |||
Actual Commit: 2353d71d4b02be6dbabe25aac1a9e56eb3b812a2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since its been a while can you bump this to v4.0.3
, commit 203fc812bda4267020165e656f55185f72df4cc0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also just curious, how often would the version need to be bumped in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that we rarely bump the version of swagger-codegen right now.
@@ -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-client/python.git | |||
pip install git+https://github.com/kubernetes-kubernetes.client/python.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these changed to this weird URL?
from .models.v2beta2_resource_metric_source import V2beta2ResourceMetricSource | ||
from .models.v2beta2_resource_metric_status import V2beta2ResourceMetricStatus | ||
from .models.version_info import VersionInfo | ||
__version__ = "9.0.0-snapshot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoudn't this be: "10.0.0-snapshot"?
@@ -68,7 +70,7 @@ except ApiException as e: | |||
|
|||
## Documentation for API Endpoints | |||
|
|||
All URIs are relative to *https://localhost* | |||
All URIs are relative to *http://localhost* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also curious why it's http now instead of https?
The |
we've migrated to openapi-generator /close |
@roycaihw: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The client has been generated by openapi-generator instead of swagger-codegen.
Ref: kubernetes-client/gen#93