Summary
Updating to Go 1.27 and bumping dependencies (controller-runtime v0.24.1, client-go v0.37.0) surfaced two deprecation warnings that were suppressed with //nolint:staticcheck / left as-is rather than migrated, to keep the dependency bump PR minimal.
1. Manager.GetEventRecorderFor (controller-runtime)
Deprecated in favor of Manager.GetEventRecorder(name) events.EventRecorder (k8s.io/client-go/tools/events), but it is not a drop-in replacement — the new Eventf signature adds a related runtime.Object and an action string:
Eventf(regarding, related runtime.Object, eventtype, reason, action, note string, args ...any)
Migrating requires:
- Changing the
Recorder field type on TypesenseClusterReconciler and TypesenseApiKeyReconciler from record.EventRecorder to events.EventRecorder.
- Rewriting all
Recorder.Event/Recorder.Eventf call sites (internal/controller/typesensecluster_controller.go, internal/controller/typesensecluster_statefulset.go) to the new signature, deciding what related object and action string make sense for each event.
Current state: suppressed with //nolint:staticcheck at the two mgr.GetEventRecorderFor(...) call sites in cmd/main.go. Note controller-runtime's own internal code and tests still call the deprecated API with the same nolint pattern, so there's no urgency, but it should eventually move to the new API.
2. scheme.Builder (controller-runtime pkg/scheme) in api/v1alpha1/groupversion_info.go
Deprecated in favor of using k8s.io/apimachinery/pkg/runtime.SchemeBuilder directly, since api packages should minimize dependencies. Not a drop-in: runtime.SchemeBuilder doesn't have the .Register(objects ...runtime.Object) convenience method that scheme.Builder provides — migrating means restructuring how TypesenseCluster/TypesenseApiKey types register themselves in api/v1alpha1/typesensecluster_types.go and api/v1alpha1/typesenseapikey_types.go (registering an AddKnownTypes func with the GroupVersion explicitly instead).
Current state: left as-is, still flagged by golangci-lint (staticcheck SA1019). This is a common, still-widely-used kubebuilder v4 scaffold pattern, so no urgency, but worth revisiting in a deliberate pass.
Summary
Updating to Go 1.27 and bumping dependencies (controller-runtime v0.24.1, client-go v0.37.0) surfaced two deprecation warnings that were suppressed with
//nolint:staticcheck/ left as-is rather than migrated, to keep the dependency bump PR minimal.1.
Manager.GetEventRecorderFor(controller-runtime)Deprecated in favor of
Manager.GetEventRecorder(name) events.EventRecorder(k8s.io/client-go/tools/events), but it is not a drop-in replacement — the newEventfsignature adds arelated runtime.Objectand anactionstring:Migrating requires:
Recorderfield type onTypesenseClusterReconcilerandTypesenseApiKeyReconcilerfromrecord.EventRecordertoevents.EventRecorder.Recorder.Event/Recorder.Eventfcall sites (internal/controller/typesensecluster_controller.go,internal/controller/typesensecluster_statefulset.go) to the new signature, deciding whatrelatedobject andactionstring make sense for each event.Current state: suppressed with
//nolint:staticcheckat the twomgr.GetEventRecorderFor(...)call sites incmd/main.go. Note controller-runtime's own internal code and tests still call the deprecated API with the same nolint pattern, so there's no urgency, but it should eventually move to the new API.2.
scheme.Builder(controller-runtime pkg/scheme) inapi/v1alpha1/groupversion_info.goDeprecated in favor of using
k8s.io/apimachinery/pkg/runtime.SchemeBuilderdirectly, since api packages should minimize dependencies. Not a drop-in:runtime.SchemeBuilderdoesn't have the.Register(objects ...runtime.Object)convenience method thatscheme.Builderprovides — migrating means restructuring howTypesenseCluster/TypesenseApiKeytypes register themselves inapi/v1alpha1/typesensecluster_types.goandapi/v1alpha1/typesenseapikey_types.go(registering anAddKnownTypesfunc with theGroupVersionexplicitly instead).Current state: left as-is, still flagged by
golangci-lint(staticcheck SA1019). This is a common, still-widely-used kubebuilder v4 scaffold pattern, so no urgency, but worth revisiting in a deliberate pass.