-
Notifications
You must be signed in to change notification settings - Fork 2.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
update openapi scripts to fetch protobuffer schemas #4582
update openapi scripts to fetch protobuffer schemas #4582
Conversation
2967b65
to
1b23231
Compare
/hold cancel |
1b23231
to
3072068
Compare
/retest |
@KnVerey pinging in case this fell off your radar |
@natasha41575: This PR has multiple commits, and the default merge method is: merge. 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. |
/label tide/merge-method-squash |
47db706
to
d0d2c75
Compare
f364b70
to
e71e76a
Compare
e71e76a
to
7f4ac84
Compare
f869229
to
6fd5980
Compare
|
||
# TODO (natasha41575) Add a `kustomize openapi fetch --proto` option | ||
kubectl proxy & | ||
sleep 5 |
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 needed to add this delay because sometimes the curl
timed out before the kubectl proxy was ready
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 have two small questions but otherwise this looks good! Tried it locally both to regen the current version and to add a second, and works well.
kyaml/openapi/openapi.go
Outdated
if kubernetesOpenAPIVersion == "" { | ||
return nil | ||
kubernetesOpenAPIVersion = version | ||
if version == "" { |
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 the switch to use the local var instead of the global one set on the line above?
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.
The global variable kubernetesOpenAPIVersion
is keeping track of whether or not a custom schema or nondefault version has been set or not (and which one it has been set to) - while the version specifies what to actually use here, which might be the default.
I actually wrote up a much longer explanation and then realized the way that this is implemented is overcomplicated, so I updated it to something that is easier to follow and closer to what it was before.
95e610b
to
a017647
Compare
a017647
to
35ba0d7
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: KnVerey, natasha41575 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 |
This should be merged after #4568, it updates the openapi scripts to fetch protobuffer schemas instead of JSON schemas.
openapiinfo.go
(which stores the version number of kubernetes openapi data that we have) will now need to be updated manually. Previously we were parsing the JSON schema to get the version number, but I'm not sure if that's feasible with protobuffer. Instead, I added instructions to the README for how to update it manually which is a pretty lightweight process.To test this, you can do the following steps:
API_VERSION=v1.21.10 make kubernetesapi/swagger.go
.BenchmarkProtoUnmarshal
inopenapi_benchmark_test.go
/cc @KnVerey
/hold