-
Notifications
You must be signed in to change notification settings - Fork 1.2k
⚠️ Deprecate pkg/config/v1alpha1 types #2149
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
⚠️ Deprecate pkg/config/v1alpha1 types #2149
Conversation
This changeset sets deprecations and brings in changes so that settable controller options are now exported in the config.Controller struct. This package has been unmaintained for a while, and the inheritance logic makes it hard to rework the Options structs in the tree of controller runtime components. Signed-off-by: Vince Prignano <vincepri@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
// Controller contains configuration options for a controller. | ||
type Controller struct { | ||
// GroupKindConcurrency is a map from a Kind to the number of concurrent reconciliation | ||
// allowed for that controller. | ||
// | ||
// When a controller is registered within this manager using the builder utilities, | ||
// users have to specify the type the controller reconciles in the For(...) call. | ||
// If the object's kind passed matches one of the keys in this map, the concurrency | ||
// for that controller is set to the number specified. | ||
// | ||
// The key is expected to be consistent in form with GroupKind.String(), | ||
// e.g. ReplicaSet in apps group (regardless of version) would be `ReplicaSet.apps`. | ||
GroupKindConcurrency map[string]int | ||
|
||
// MaxConcurrentReconciles is the maximum number of concurrent Reconciles which can be run. Defaults to 1. | ||
MaxConcurrentReconciles int | ||
|
||
// CacheSyncTimeout refers to the time limit set to wait for syncing caches. | ||
// Defaults to 2 minutes if not set. | ||
CacheSyncTimeout time.Duration | ||
|
||
// RecoverPanic indicates whether the panic caused by reconcile should be recovered. | ||
// Defaults to the Controller.RecoverPanic setting from the Manager if unset. | ||
RecoverPanic *bool | ||
|
||
// NeedLeaderElection indicates whether the controller needs to use leader election. | ||
// Defaults to true, which means the controller will use leader election. | ||
NeedLeaderElection *bool | ||
} |
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.
These options have to live in a different package, otherwise controller <-> manager get into a import cycle
/retestOn Jan 27, 2023, at 11:55 AM, Kubernetes Prow Robot ***@***.***> wrote:
@vincepri: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
Test name
Commit
Details
Required
Rerun command
pull-controller-runtime-test-master
cb5fcac
link
true
/test pull-controller-runtime-test-master
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
/retest |
/lgtm |
/retest |
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.
Overall lgtm
@@ -37,7 +37,7 @@ import ( | |||
"sigs.k8s.io/controller-runtime/pkg/client" | |||
"sigs.k8s.io/controller-runtime/pkg/cluster" | |||
"sigs.k8s.io/controller-runtime/pkg/config" | |||
"sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" | |||
"sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" //nolint:staticcheck // TODO: remove this import when v1alpha1 is removed |
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: this comment seems redundant, given that the code won't compile anymore once v1alpha1 is removed
configv1alpha1 "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" | ||
) | ||
|
||
var _ = Describe("manager.Options", 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.
Shouldn't we keep the tests while the code is still there and only deprecated?
(similar in other cases)
/retest |
Didn't realize the restest merges it |
Hi, controller-runtime users here, so if I depend on the configurations like |
This changeset sets deprecations and brings in changes so that settable controller options are now exported in the config.Controller struct. This package has been unmaintained for a while, and the inheritance logic makes it hard to rework the Options structs in the tree of controller runtime components.
Signed-off-by: Vince Prignano vincepri@redhat.com