-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Remove defaulting from shared ComponentConfig types #67207
Remove defaulting from shared ComponentConfig types #67207
Conversation
} | ||
|
||
func SetDefaults_ClientConnectionConfiguration(obj *ClientConnectionConfiguration) { | ||
func DefaultClientConnectionConfiguration(obj *ClientConnectionConfiguration) { |
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.
RecommendedDefaultClientConnectionConfiguration
. godoc indicating that it is subject to change as our recommendations change (same as the options structs we have today in apiserver) and an explanation that providing this method is a courtesy if you find that wish to use it in your config. It is intentionallly not registered in the scheme so that callers have flexibility to choose their own defaults. Conversion relies on defaulting, so if we did not do this, our conversion may accidentally rely on this.
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.
added godoc comment to both types
var ( | ||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. | ||
SchemeBuilder runtime.SchemeBuilder | ||
localSchemeBuilder = &SchemeBuilder |
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.
zz_generated.conversion.go will be unhappy with this being gone, I expect
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.
ah yeah of course, was a bit too quick in removing, readded
var ( | ||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. | ||
SchemeBuilder runtime.SchemeBuilder | ||
localSchemeBuilder = &SchemeBuilder |
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.
same here, conversion needs this, right?
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.
readded
5ed6ed0
to
a4103ae
Compare
a4103ae
to
1b23465
Compare
/test pull-kubernetes-e2e-kops-aws |
/sig api-machinery |
LGTM |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, luxas 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 |
/test pull-kubernetes-integration |
/retest |
Automatic merge from submit-queue (batch tested with PRs 66602, 67178, 67207, 67125, 66332). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove references to the structs that have moved to their own packages **What this PR does / why we need it**: Follows-up #66058 and #66059 to remove the structs that now aren't needed in `pkg/apis/componentconfig` **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: xref kubernetes/community#2354 **Special notes for your reviewer**: This PR depends on: - [x] #67090 - [x] #67149 - [x] #67159 - [x] #67207 **Only review commit 'Remove references to the structs that have moved to their own packages' please** **Release note**: ```release-note NONE ``` /kind cleanup /assign @sttts @thockin @jbeda @liggitt
/assign @cheftako |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. Refactor the kube-controller-manager ComponentConfig structs **What this PR does / why we need it**: This PR cleans up the kube-controller-manager structs in the componentconfig package and fixes various structural issues in the current code, in order to make it possible to later move the code out to external API groups (as a starting point `GenericControllerManagerConfiguration` to `k8s.io/controller-manager`). **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: ref: kubernetes/community#2354 This PR depends on: - [x] #67149 - [x] #67090 - [x] #67159 - [x] #67207 - [x] #66722 **Special notes for your reviewer**: Please only review the following commits: - **Refactor the k-c-m ComponentConfig structs to they can be moved out** - **Fixup cmd/kube-controller-manager code after struct changes.** **Release note**: ```release-note NONE ``` /assign @sttts @stewart-yu @liggitt @thockin
What this PR does / why we need it:
As @deads2k commented in kubernetes/community#2354, we should not register defaults for the shared componentconfig types as it gets very hard for consumer to opt-out of the default defaulting funcs. Instead, the package provides a
DefaultFoo
function the consuming API group can call if it wants to as an opt-in inSetDefaults_Bar
(whereBar
wrapsFoo
as a field)Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):ref: kubernetes/community#2354
Special notes for your reviewer:
Release note:
/assign @sttts @liggitt @deads2k