Skip to content

Commit

Permalink
Change NewKindWithFixedCache to NewKindWithCache
Browse files Browse the repository at this point in the history
  • Loading branch information
kramerul committed Feb 11, 2020
1 parent befff0b commit f515d1e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ type Source interface {
Start(handler.EventHandler, workqueue.RateLimitingInterface, ...predicate.Predicate) error
}

// NewKindWithFixedCache creates a Source without InjectCache, so that it is assured that the given cache is used
// NewKindWithCache creates a Source without InjectCache, so that it is assured that the given cache is used
// and not overwritten. It can be used to watch objects in a different cluster by passing the cache
// from that other cluster
func NewKindWithFixedCache(object runtime.Object, cache cache.Cache) Source {
return &kindWithFixedCache{kind: Kind{Type: object, cache: cache}}
func NewKindWithCache(object runtime.Object, cache cache.Cache) Source {
return &kindWithCache{kind: Kind{Type: object, cache: cache}}
}

type kindWithFixedCache struct {
type kindWithCache struct {
kind Kind
}

func (ks *kindWithFixedCache) Start(handler handler.EventHandler, queue workqueue.RateLimitingInterface,
func (ks *kindWithCache) Start(handler handler.EventHandler, queue workqueue.RateLimitingInterface,
prct ...predicate.Predicate) error {
return ks.kind.Start(handler, queue, prct...)
}
Expand Down

0 comments on commit f515d1e

Please sign in to comment.