-
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
Refactor the kube-controller-manager ComponentConfig structs #66993
Refactor the kube-controller-manager ComponentConfig structs #66993
Conversation
/hold |
CloudProvider CloudProviderConfiguration `json:"cloudProvider"` | ||
// externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external". | ||
// It is currently used by the in repo cloud providers to handle node and volume control in the KCM. | ||
ExternalCloudVolumePlugin string `json:"externalCloudVolumePlugin"` |
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.
ExternalCloudVolumePlugin
not belong to cloud-controller-manager
now, should not place in KubeCloudSharedConfiguration
. WDYT
// '-foo' means "disable 'foo'" | ||
// first item for a particular name wins | ||
Controllers []string `json:"controllers"` | ||
// DebuggingConfiguration holds configuration for Debugging related features. |
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.
Controllers
also belong to kube-cc
, does we want add it to cloud-cc
?
zero := metav1.Duration{} | ||
// Port | ||
if obj.Address == "" { | ||
obj.Address = "0.0.0.0" | ||
} | ||
if obj.RouteReconciliationPeriod == zero { | ||
obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second} |
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.
Does RouteReconciliationPeriod
in KubeCloudSharedConfiguration
?
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.
fixed
6c17d45
to
584e09b
Compare
de82b24
to
e54c52b
Compare
Automatic merge from submit-queue (batch tested with PRs 67160, 67090, 67159, 66866, 62111). 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 `pkg/apis/componentconfig/install` and fix inconsistencies **What this PR does / why we need it**: This PR fixes a bunch of problems with the (deprecated, monolithic, to be removed) componentconfig API group: - As discussed with @liggitt, the current structure of k-c-m componentconfig types is really bad, and we don't want anyone to think it can be serialized (not that we have any such code, but anyway). So we deciided to remove all JSON tags from the types to be consistent, register the violations, then move types out, get the structure right, and **first then** add JSON tags. - There should not be an `install` package for componentconfigs that installs stuff in `legacyscheme`, removed the package and references to it. - Added myself and @sttts to approvers for `pkg/apis/componentconfig`, which we intend to remove in favor for dedicated API groups in different staging repos. - Removed the componentconfig types from the API testing in `pkg/api/testing`, that roundtrip and defaulting testing will exist in the dedicated API groups instead. Added a TODO to add roundtrip, defaulting and type tag testing later. - Made the `register.go` files more consistent to the common template. **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**: This PR must merge before kubernetes#66722 and kubernetes#66993 **Release note**: ```release-note NONE ``` @kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-cluster-lifecycle-pr-reviews /assign @sttts @thockin @jbeda @liggitt
TestSchedulerOptions is broken, nil pointer panic. |
/approve Based on @sttts giving it an lgtm. |
@@ -110,12 +108,14 @@ func autoConvert_v1alpha1_KubeSchedulerConfiguration_To_config_KubeSchedulerConf | |||
if err := Convert_v1alpha1_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { | |||
return err | |||
} | |||
if err := configv1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { | |||
// TODO: Inefficient conversion - can we improve it? | |||
if err := s.Convert(&in.ClientConnection, &out.ClientConnection, 0); err != nil { |
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.
this conversion isn't 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.
ugh, I have no idea what happened there wrt the autogenerated code. Can't reproduce either
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 seen this independently from this PR. Looks like we have another code generation bug, maybe in the vicinity of Makefile.generated_files. /cc @thockin
/hold there are some outstanding issues to resolve before merge:
|
ed69833
to
b4a51f1
Compare
New changes are detected. LGTM label has been removed. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jbeda, luxas, sttts 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 |
Ugh, I have no idea what happened with the generated code on the last push. Good you and the tests noticed the wrongly-autogenerated file in the last push.
adressed |
/hold cancel |
/retest |
lgtm, but has conflicts according to github |
fs.DurationVar(&o.ControllerStartInterval.Duration, "controller-start-interval", o.ControllerStartInterval.Duration, "Interval between starting controller managers.") | ||
// TODO: complete the work of the cloud-controller-manager (and possibly other consumers of this code) respecting the --controllers flag | ||
fs.StringSliceVar(&o.Controllers, "controllers", o.Controllers, fmt.Sprintf(""+ | ||
"A list of controllers to enable. '*' enables all on-by-default controllers, 'foo' enables the controller "+ |
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.
nit: space too much
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.
fixed
if err := o.Debugging.ApplyTo(&cfg.Debugging); err != nil { | ||
return err | ||
} | ||
cfg.Port = o.Port |
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.
newline above port
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.
fixed
if o == nil { | ||
return nil | ||
} | ||
|
||
errs := []error{} | ||
errs = append(errs, o.Debugging.Validate()...) | ||
allControllersSet := sets.NewString(allControllers...) |
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.
newline 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.
fixed
b4a51f1
to
b17d7bf
Compare
/test all [submit-queue is verifying that this PR is safe to merge] |
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. |
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
tok8s.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:
pkg/apis/componentconfig/install
and fix inconsistencies #67090Special notes for your reviewer:
Please only review the following commits:
Release note:
/assign @sttts @stewart-yu @liggitt @thockin