Make scheduler not miss deletion events even in the case of a resync.

This commit is contained in:
Daniel Smith
2015-04-07 16:44:08 -07:00
parent 880f922bb6
commit 5f7715f0e9
4 changed files with 64 additions and 41 deletions

View File

@@ -68,6 +68,9 @@ type ExplicitKey string
// The key uses the format <namespace>/<name> unless <namespace> is empty, then
// it's just <name>.
func MetaNamespaceKeyFunc(obj interface{}) (string, error) {
if key, ok := obj.(ExplicitKey); ok {
return string(key), nil
}
meta, err := meta.Accessor(obj)
if err != nil {
return "", fmt.Errorf("object has no meta: %v", err)