Upgrading sigs.k8s.io/controller-runtime 0.20 to 0.21
Breakingv0.20.4 → v0.21.0Breaking3Deprecated1New9Changed83Fixed16Other10
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- Clients no longer throttle requests by default; you can restore the old behavior with QPS 20 and Burst 30.
- You can now create unmanaged controllers without passing a manager.
- All Go runtime metrics are now exposed by default.
- The Requeue field is deprecated; use RequeueAfter instead.
Must act 4 items need code or config changes
What you must change
Breaking3
Stops enabling the client-side ratelimiter by default in config.
rest.ConfigNewUnmanaged and NewTypedUnmanaged no longer require a manager.
NewUnmanagedNewTypedUnmanagedExposes all Go runtime metrics.
Deprecations to plan for
Deprecated1
Deprecates Result.Requeue in reconcile.
Result.RequeueAPI changes
Generated by DepDelta from published Go source. Not mixed with prose notes.
- added:
method WebhookBuilder.WithDefaulterCustomPath(string) *WebhookBuilder - added:
method WebhookBuilder.WithValidatorCustomPath(string) *WebhookBuilder
- changed:
field Options.DefaultWatchErrorHandler: toolscache.WatchErrorHandler → field Options.DefaultWatchErrorHandler: toolscache.WatchErrorHandlerWithContext - added:
method Informer.AddEventHandlerWithOptions(toolscache.ResourceEventHandler, toolscache.HandlerOptions) (toolscache.ResourceEventHandlerRegistration, error)
- added:
field Controller.Logger: logr.Logger
- changed:
func NewTypedUnmanaged[request comparable](string, manager.Manager, TypedOptions[request]) (TypedController[request], error) → func NewTypedUnmanaged[request comparable](string, TypedOptions[request]) (TypedController[request], error) - changed:
func NewUnmanaged(string, manager.Manager, Options) (Controller, error) → func NewUnmanaged(string, Options) (Controller, error) - added:
field TypedOptions.Logger: logr.Logger - added:
field TypedOptions.UsePriorityQueue: *bool - added:
method TypedOptions.DefaultFromConfig(config.Controller)
- added:
method FakeInformer.AddEventHandlerWithOptions(cache.ResourceEventHandler, cache.HandlerOptions) (cache.ResourceEventHandlerRegistration, error) - added:
method FakeInformer.RunWithContext(context.Context) - added:
method FakeInformer.SetWatchErrorHandlerWithContext(cache.WatchErrorHandlerWithContext) error
- added:
field Environment.DownloadBinaryAssets: bool - added:
field Environment.DownloadBinaryAssetsIndexURL: string - added:
field Environment.DownloadBinaryAssetsVersion: string - added:
field Environment.KubeConfig: []byte - added:
func SetupEnvtestDefaultBinaryAssetsDirectory() (string, error) - added:
var DefaultBinaryAssetsIndexURL
- added:
field TypedCreateEvent.IsInInitialList: bool
- removed:
method KubeAPIWarningLogger.HandleWarningHeader(int, string, string) - changed:
func NewKubeAPIWarningLogger(logr.Logger, KubeAPIWarningLoggerOptions) *KubeAPIWarningLogger → func NewKubeAPIWarningLogger(KubeAPIWarningLoggerOptions) *KubeAPIWarningLogger - added:
method KubeAPIWarningLogger.HandleWarningHeaderWithContext(context.Context, int, string, string)