From f003445533ff460e4e502453d6c779c64061963e Mon Sep 17 00:00:00 2001 From: Rohit Ramkumar Date: Wed, 25 Jul 2018 11:29:35 -0700 Subject: [PATCH] Rename context's hcLock to lock --- pkg/context/context.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/context/context.go b/pkg/context/context.go index a777749cfb..bbe29cb1ef 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -54,7 +54,8 @@ type ControllerContext struct { EndpointInformer cache.SharedIndexInformer healthChecks map[string]func() error - hcLock sync.Mutex + + lock sync.Mutex // Map of namespace => record.EventRecorder. recorders map[string]record.EventRecorder @@ -141,8 +142,8 @@ func (ctx *ControllerContext) Recorder(ns string) record.EventRecorder { // AddHealthCheck registers function to be called for healthchecking. func (ctx *ControllerContext) AddHealthCheck(id string, hc func() error) { - ctx.hcLock.Lock() - defer ctx.hcLock.Unlock() + ctx.lock.Lock() + defer ctx.lock.Unlock() ctx.healthChecks[id] = hc } @@ -152,8 +153,8 @@ type HealthCheckResults map[string]error // HealthCheck runs all registered healthcheck functions. func (ctx *ControllerContext) HealthCheck() HealthCheckResults { - ctx.hcLock.Lock() - defer ctx.hcLock.Unlock() + ctx.lock.Lock() + defer ctx.lock.Unlock() healthChecks := make(map[string]error) for component, f := range ctx.healthChecks {