From 8a6fdfd6483a365000a8a8debc8de2683af602b9 Mon Sep 17 00:00:00 2001 From: Ziheng Liu Date: Mon, 28 Oct 2019 19:22:06 -0400 Subject: [PATCH] Fix a data race in registrytest Signed-off-by: Ziheng Liu --- pkg/registry/registrytest/node.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/registry/registrytest/node.go b/pkg/registry/registrytest/node.go index 9186006a2fc..35791092d31 100644 --- a/pkg/registry/registrytest/node.go +++ b/pkg/registry/registrytest/node.go @@ -114,5 +114,7 @@ func (r *NodeRegistry) DeleteNode(ctx context.Context, nodeID string) error { } func (r *NodeRegistry) WatchNodes(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) { + r.Lock() + defer r.Unlock() return nil, r.Err }