Skip to content

Commit

Permalink
added a note explaining why routerKeyFn was added
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobTanenbaum committed Mar 22, 2017
1 parent 7c42b7e commit 101ab9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/router/controller/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func NewDefaultRouterControllerFactory(oc osclient.RoutesNamespacer, kc kclients
}
}

// routerKeyFn comes from MetaNamespaceKeyFunc in vendor/k8s.io/kubernetes/pkg/client/cache/store.go.
// It was modified and added here because there is no way to know if an ExplicitKey was passed before
// adding the UID to prevent an invalid state transistion if deletions and adds happen quickly.
func routerKeyFn(obj interface{}) (string, error) {
if key, ok := obj.(cache.ExplicitKey); ok {
return string(key), nil
Expand Down

0 comments on commit 101ab9d

Please sign in to comment.