Skip to content

Commit

Permalink
Update interface name
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishnaviHire committed Dec 3, 2024
1 parent 75d3e39 commit f3ef8ef
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apis/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type WithDevFlags interface {
GetDevFlags() *DevFlags
}

type BaseObject interface {
type PlatformObject interface {
client.Object
WithStatus
WithDevFlags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (a *Action) run(ctx context.Context, rr *types.ReconciliationRequest) error
var err error
var cachingKey []byte

inst, ok := rr.Instance.(common.BaseObject)
inst, ok := rr.Instance.(common.PlatformObject)
if ok && inst.GetDevFlags() != nil {
// if dev flags are enabled, caching is disabled as dev flags are meant for
// development time only where caching is not relevant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (a *Action) run(ctx context.Context, rr *types.ReconciliationRequest) error
var err error
var cachingKey []byte

inst, ok := rr.Instance.(common.BaseObject)
inst, ok := rr.Instance.(common.PlatformObject)
if ok && inst.GetDevFlags() != nil {
// if dev flags are enabled, caching is disabled as dev flags are meant for
// development time only where caching is not relevant
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

// Reconciler provides generic reconciliation functionality for ODH objects.
type Reconciler[T common.BaseObject] struct {
type Reconciler[T common.PlatformObject] struct {
Client *odhClient.Client
Scheme *runtime.Scheme
Actions []actions.Fn
Expand All @@ -43,7 +43,7 @@ type Reconciler[T common.BaseObject] struct {
}

// NewReconciler creates a new reconciler for the given type.
func NewReconciler[T common.BaseObject](mgr manager.Manager, name string, object T) (*Reconciler[T], error) {
func NewReconciler[T common.PlatformObject](mgr manager.Manager, name string, object T) (*Reconciler[T], error) {
oc, err := odhClient.NewFromManager(mgr)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/reconciler/reconciler_actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
func TestDynamicWatchAction_Run(t *testing.T) {
tests := []struct {
name string
object common.BaseObject
object common.PlatformObject
preds []DynamicPredicate
errMatcher gomegaTypes.GomegaMatcher
cntMatcher gomegaTypes.GomegaMatcher
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/reconciler/reconciler_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Dynamic(predicates ...DynamicPredicate) WatchOpts {
}
}

type ReconcilerBuilder[T common.BaseObject] struct {
type ReconcilerBuilder[T common.PlatformObject] struct {
mgr ctrl.Manager
input forInput
watches []watchInput
Expand All @@ -96,7 +96,7 @@ type ReconcilerBuilder[T common.BaseObject] struct {
errors error
}

func ReconcilerFor[T common.BaseObject](mgr ctrl.Manager, object T, opts ...builder.ForOption) *ReconcilerBuilder[T] {
func ReconcilerFor[T common.PlatformObject](mgr ctrl.Manager, object T, opts ...builder.ForOption) *ReconcilerBuilder[T] {
crb := ReconcilerBuilder[T]{
mgr: mgr,
}
Expand Down

0 comments on commit f3ef8ef

Please sign in to comment.