Check expectations before filtering through active pods.

This commit is contained in:
Prashanth Balasubramanian
2015-05-12 14:39:23 -07:00
parent 2f2816368f
commit 54b6501349
3 changed files with 55 additions and 3 deletions

View File

@@ -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