Check expectations before filtering through active pods.
This commit is contained in:
@@ -58,6 +58,17 @@ var expKeyFunc = func(obj interface{}) (string, error) {
|
||||
return "", fmt.Errorf("Could not find key for obj %#v", obj)
|
||||
}
|
||||
|
||||
// RCExpectationsManager is an interface that allows users to set and wait on expectations.
|
||||
// Only abstracted out for testing.
|
||||
type RCExpectationsManager interface {
|
||||
GetExpectations(rc *api.ReplicationController) (*PodExpectations, bool, error)
|
||||
SatisfiedExpectations(rc *api.ReplicationController) bool
|
||||
ExpectCreations(rc *api.ReplicationController, adds int) error
|
||||
ExpectDeletions(rc *api.ReplicationController, dels int) error
|
||||
CreationObserved(rc *api.ReplicationController)
|
||||
DeletionObserved(rc *api.ReplicationController)
|
||||
}
|
||||
|
||||
// RCExpectations is a ttl cache mapping rcs to what they expect to see before being woken up for a sync.
|
||||
type RCExpectations struct {
|
||||
cache.Store
|
||||
|
Reference in New Issue
Block a user