-
Notifications
You must be signed in to change notification settings - Fork 214
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
OpenAPIDefinitionGetter interface is incorrect #514
Comments
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
This comment has been minimized.
This comment has been minimized.
What exactly is breaking by returning a pointer? This would be a backwards incompatible change so I'd be quite skeptical unless something is broken in a major way. |
As it stands, implementing the interface means your code won’t work — that is broken. We can either change the code to actually expect what the interface declares, or we can change the interface to match what the code expects, but having these things not match makes no sense IMO. |
Ah I see, it looks like we have a mix of usages of the pointer and struct kube-openapi/pkg/builder/openapi_test.go Line 62 in 2c72e55
and since nothing validates the interface implementation, both tests pass 😓 . Definitely seems like a bug |
kube-openapi has two interfaces
However, implementing this doesn't actually work, because they're incorrectly specified. The methods actually need to return the structs directly, not a pointer of the struct, for it to work. Since the generator never actually checks for the interface, but purely for the existence of the method, this goes unnoticed.
The interfaces actually should be declared as
The text was updated successfully, but these errors were encountered: