-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
✨ enable conversion webhook by default #427
✨ enable conversion webhook by default #427
Conversation
3a254c3
to
09c23f1
Compare
return err | ||
err = conversion.CheckConvertibility(blder.mgr.GetScheme(), blder.apiType) | ||
if err != nil { | ||
log.Error(err, "conversion check failed", "GVK", gvk) |
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'm concerned that this error is going to be a bit spam-y for non-conversion cases (e.g. built-ins). Maybe we should have an explicit opt-in on the builder?
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.
for posterity:
- error out if there's a partial implementation (hub w/o spokes, spokes w/o hub, partial set of spokes, multiple hubs, etc)
- log on success at
V(1).Info("conversioned enabled for kind", "kind", groupKind, "hub", hubVersion, "spokes", spokeVersions)
so that people can look for that line to debug too, or check for it's absence if they've failed to implement anything.
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'm concerned that this error is going to be a bit spam-y for non-conversion cases (e.g. built-ins).
If kube-apiserver sends us conversion requests for built-ins, it means there is a bug in kube-apiserver, right?
EDIT: nvm. Sunil explained to me.
09c23f1
to
baffe2d
Compare
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
|
||
It("should not return error for a built-in multi-version type", func() { |
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.
we should probably have a test for the error case
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.
Yes, we should. It requires adding new type definitions (with partial conversion implementation), I will do that in a follow up PR.
baffe2d
to
8da12a6
Compare
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.
Cleaned up the go.mod/sum files. Ready to go now.
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
|
||
It("should not return error for a built-in multi-version type", func() { |
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.
Yes, we should. It requires adding new type definitions (with partial conversion implementation), I will do that in a follow up PR.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, droot 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 |
change import path to use vanity URL sigs.k8s.io
This PR enables conversion webhook by default.
It also logs a warning at startup if a type is a multi-version and doesn't implement conversion. Users will get a false-positive if they build a controller for non-managed multi-version types. Looking for ideas to handle it better.