Skip to content

Commit d302a64

Browse files
authored
simplify versioned handler (#2897)
1 parent c739dd5 commit d302a64

File tree

3 files changed

+160
-130
lines changed

3 files changed

+160
-130
lines changed

pkg/controller/state/reconciler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"sigs.k8s.io/controller-runtime/pkg/log"
3535
"sigs.k8s.io/controller-runtime/pkg/reconcile"
3636

37+
"github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/generated/translate"
3738
"github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/finalizer"
3839
"github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/state"
3940
)
@@ -44,6 +45,8 @@ type Result struct {
4445
StateMsg string
4546
}
4647

48+
type VersionedHandlerFunc[C any, T any] func(client client.Client, atlasClient *C, translator *translate.Request) StateHandler[T]
49+
4750
type StateHandler[T any] interface {
4851
SetupWithManager(ctrl.Manager, reconcile.Reconciler, controller.Options) error
4952
For() (client.Object, builder.Predicates)

0 commit comments

Comments
 (0)