Upgrading sigs.k8s.io/controller-runtime 0.22 to 0.23
Breakingv0.22.5 → v0.23.3Breaking5New11Changed78Fixed21Other19
BreakingUpgrade verdict
5 breaking changes.
In plain terms
- Updates k8s.io/* dependencies to v1.35.
- Adds subresource Apply support to the client, a breaking change.
- If you use the new event recorder, update your permissions so events are allowed under events.k8s.io instead of the core group.
- Sets ResourceVersion for SSA Create in the fake client.
Must act Top 3 of 5 that need code or config changes
What you must change
Breaking5
Updates k8s.io/* dependencies to v1.35.
Adds subresource Apply support to the client, a breaking change.
Migrates to the new events API; GetEventRecorderFor now requires RBAC on the events.k8s.io apiGroup.
GetEventRecorderForSets ResourceVersion for SSA Create in the fake client.
Makes Validator and Defaulter webhooks generic, requiring the concrete object type instead of runtime.Object.
builder.WebhookManagedByValidateCreateAPI changes
Generated by DepDelta from published Go source. Not mixed with prose notes.
- removed:
var NewWebhookManagedBy - added:
func NewWebhookManagedBy[T runtime.Object](manager.Manager, T) *builder.WebhookBuilder[T] - added:
var CreateOrPatch
- removed:
func WebhookManagedBy(manager.Manager) *WebhookBuilder - removed:
method WebhookBuilder.For(runtime.Object) *WebhookBuilder - changed:
method WebhookBuilder.RecoverPanic(bool) *WebhookBuilder → method WebhookBuilder.RecoverPanic(bool) *WebhookBuilder[T] - changed:
method WebhookBuilder.WithCustomPath(string) *WebhookBuilder → method WebhookBuilder.WithCustomPath(string) *WebhookBuilder[T] - changed:
method WebhookBuilder.WithDefaulter(admission.CustomDefaulter, ...admission.DefaulterOption) *WebhookBuilder → method WebhookBuilder.WithDefaulter(admission.Defaulter[T], ...admission.DefaulterOption) *WebhookBuilder[T] - changed:
method WebhookBuilder.WithDefaulterCustomPath(string) *WebhookBuilder → method WebhookBuilder.WithDefaulterCustomPath(string) *WebhookBuilder[T] - changed:
method WebhookBuilder.WithLogConstructor(func(base logr.Logger, req *admission.Request) logr.Logger) *WebhookBuilder → method WebhookBuilder.WithLogConstructor(func(base logr.Logger, req *admission.Request) logr.Logger) *WebhookBuilder[T] - changed:
method WebhookBuilder.WithValidator(admission.CustomValidator) *WebhookBuilder → method WebhookBuilder.WithValidator(admission.Validator[T]) *WebhookBuilder[T] - changed:
method WebhookBuilder.WithValidatorCustomPath(string) *WebhookBuilder → method WebhookBuilder.WithValidatorCustomPath(string) *WebhookBuilder[T] - changed:
type WebhookBuilder: struct → type WebhookBuilder: [T runtime.Object] struct - added:
func WebhookManagedBy[T runtime.Object](manager.Manager, T) *WebhookBuilder[T] - added:
method WebhookBuilder.WithContextFunc(func(context.Context, *http.Request) context.Context) *WebhookBuilder[T] - added:
method WebhookBuilder.WithConverter(func(*runtime.Scheme) (conversion.Converter, error)) *WebhookBuilder[T] - added:
method WebhookBuilder.WithCustomDefaulter(admission.CustomDefaulter, ...admission.DefaulterOption) *WebhookBuilder[T] - added:
method WebhookBuilder.WithCustomValidator(admission.CustomValidator) *WebhookBuilder[T]
- removed:
field ErrResourceNotCached.GVK: schema.GroupVersionKind - removed:
method ErrResourceNotCached.Error() string - changed:
type ErrResourceNotCached: struct → type ErrResourceNotCached = internal.ErrResourceNotCached
- added:
field Options.FieldOwner: string - added:
field Options.FieldValidation: string - added:
field SubResourceApplyOptions.ApplyOptions: embedded ApplyOptions - added:
field SubResourceApplyOptions.SubResourceBody: runtime.ApplyConfiguration - added:
method FieldOwner.ApplyToSubResourceApply(*SubResourceApplyOptions) - added:
method SubResourceApplyOption.ApplyToSubResourceApply(*SubResourceApplyOptions) - added:
method SubResourceApplyOptions.ApplyOpts([]SubResourceApplyOption) *SubResourceApplyOptions - added:
method SubResourceApplyOptions.ApplyToSubResourceApply(*SubResourceApplyOptions) - added:
method SubResourceClient.Apply(context.Context, runtime.ApplyConfiguration, ...SubResourceApplyOption) error - added:
method SubResourceWriter.Apply(context.Context, runtime.ApplyConfiguration, ...SubResourceApplyOption) error - added:
type SubResourceApplyOption: interface - added:
type SubResourceApplyOptions: struct
- added:
field Funcs.SubResourceApply: func(ctx context.Context, client client.Client, subResourceName string, obj runtime.ApplyConfiguration, opts ...client.SubResourceApplyOption) error
- removed:
method Cluster.GetEventRecorderFor(string) record.EventRecorder - changed:
type Cluster: interface → type Cluster: interface{recorder.Provider}
- added:
field FakeInformer.SyncedLock: sync.Mutex
- changed:
func FromContext(context.Context, ...interface{}) logr.Logger → func FromContext(context.Context, ...any) logr.Logger - changed:
method NullLogSink.Error(error, string, ...interface{}) → method NullLogSink.Error(error, string, ...any) - changed:
method NullLogSink.Info(int, string, ...interface{}) → method NullLogSink.Info(int, string, ...any) - changed:
method NullLogSink.WithValues(...interface{}) logr.LogSink → method NullLogSink.WithValues(...any) logr.LogSink
- added:
method Manager.GetConverterRegistry() conversion.Registry
- added:
field Result.Priority: *int
- added:
method Provider.GetEventRecorder(string) events.EventRecorder
- removed:
method CustomDefaulter.Default(context.Context, runtime.Object) error - removed:
method CustomValidator.ValidateCreate(context.Context, runtime.Object) (Warnings, error) - removed:
method CustomValidator.ValidateDelete(context.Context, runtime.Object) (Warnings, error) - removed:
method CustomValidator.ValidateUpdate(context.Context, runtime.Object, runtime.Object) (Warnings, error) - changed:
type CustomDefaulter: interface → type CustomDefaulter = Defaulter[runtime.Object] - changed:
type CustomValidator: interface → type CustomValidator = Validator[runtime.Object] - added:
func WithDefaulter[T runtime.Object](*runtime.Scheme, Defaulter[T], ...DefaulterOption) *Webhook - added:
func WithValidator[T runtime.Object](*runtime.Scheme, Validator[T]) *Webhook - added:
method Defaulter.Default(context.Context, T) error - added:
method Validator.ValidateCreate(context.Context, T) (Warnings, error) - added:
method Validator.ValidateDelete(context.Context, T) (Warnings, error) - added:
method Validator.ValidateUpdate(context.Context, T, T) (Warnings, error) - added:
type Defaulter: [T runtime.Object] interface - added:
type Validator: [T runtime.Object] interface
- changed:
func NewWebhookHandler(*runtime.Scheme) http.Handler → func NewWebhookHandler(*runtime.Scheme, Registry) http.Handler - added:
func NewHubSpokeConverter[hubObject runtime.Object](hubObject, ...SpokeConverter[hubObject]) func(scheme *runtime.Scheme) (Converter, error) - added:
func NewRegistry() Registry - added:
func NewSpokeConverter[hubObject, spokeObject client.Object](spokeObject, func(ctx context.Context, src hubObject, dst spokeObject) error, func(ctx context.Context, src spokeObject, dst hubObject) error) SpokeConverter[hubObject] - added:
method Converter.ConvertObject(context.Context, runtime.Object, runtime.Object) error - added:
method Registry.GetConverter(schema.GroupKind) (Converter, bool) - added:
method Registry.RegisterConverter(schema.GroupKind, Converter) error - added:
method SpokeConverter.ConvertHubToSpoke(context.Context, hubObject, runtime.Object) error - added:
method SpokeConverter.ConvertSpokeToHub(context.Context, runtime.Object, hubObject) error - added:
method SpokeConverter.GetSpoke() runtime.Object - added:
type Converter: interface - added:
type Registry: interface - added:
type SpokeConverter: [hubObject runtime.Object] interface