Commit 08342c1f authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38825 from enj/enj/i/store_dead_code/38822

Automatic merge from submit-queue Remove dead code in `pkg/registry/generic/registry/store.go` Fixes #38822 Depending on the intent of the original code, the correct fix may instead be: ```go if name, ok := p.MatchesSingle(); ok { key, err := e.KeyFunc(ctx, name) if err != nil { return nil, err } w, err := e.Storage.Watch(ctx, key, resourceVersion, p) if err != nil { return nil, err } if e.Decorator != nil { return newDecoratedWatcher(w, e.Decorator), nil } return w, nil // if we cannot extract a key based on the current context, the optimization is skipped } ``` Signed-off-by: 's avatarMonis Khan <mkhan@redhat.com> cc @deads2k
parents de3b73bd 91cb57d9
......@@ -879,9 +879,6 @@ func (e *Store) Watch(ctx api.Context, options *api.ListOptions) (watch.Interfac
func (e *Store) WatchPredicate(ctx api.Context, p storage.SelectionPredicate, resourceVersion string) (watch.Interface, error) {
if name, ok := p.MatchesSingle(); ok {
if key, err := e.KeyFunc(ctx, name); err == nil {
if err != nil {
return nil, err
}
w, err := e.Storage.Watch(ctx, key, resourceVersion, p)
if err != nil {
return nil, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment