Closed dominiquelefevre closed 1 year ago
Welcome @dominiquelefevre!
It looks like this is your first PR to kubernetes/kube-openapi 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes/kube-openapi has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
All of spec/fuzz.go
is used for tests and should never be imported in an actual program, not just the diff options.
Should we move the whole file in a spectest
package?
All of
spec/fuzz.go
is used for tests and should never be imported in an actual program, not just the diff options. Should we move the whole file in aspectest
package?
Oh, that's absolutely reasonable. Renamed the whole file to fuzz_test.go
so that it is included into test builds only.
Are we 100% sure that none of this is used outside of this repo? Will this break kubernetes/kubernetes?
Are we 100% sure that none of this is used outside of this repo? Will this break kubernetes/kubernetes?
I've grepped the k8s source for SwaggerFuzzFuncs
and SwaggerDiffOptions
. Kube-openapi's pkg/validation/spec is the only place where I find them.
Moreover, I've tested the patch with a project of my own that uses a bunch of k8s.io/* libs and even k8s.io/apiserver. It compiles just fine.
ping @apelisse
I don't see this being used anywhere, so it looks good to me. /assign @liggitt
/approve /lgtm
Hi, anybody out here? @sttts please have a look at the patch.
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: dominiquelefevre, liggitt, sttts
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Go-cmp relies heavily on reflection in ways that casue the golang compiler to disable the dead code elimination. Even declaring a variable of type cmp.Option disables the DCE.
Pkg/validation/spec has SwaggerDiffOptions that is only used in tests, but is declared in the package itself. This disables the DCE in every user of k8s.io/client-go. Move SwaggerDiffOptions to swagger_test.go where it belongs.