fix lock bug for componentGlobalsRegistry

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: d31aebe57224b678a0c17df7766d8e7f850209e8
This commit is contained in:
Siyuan Zhang 2024-07-05 15:50:10 +00:00 committed by Kubernetes Publisher
parent aa4d1a9cc7
commit 6f7147fc9d
1 changed files with 2 additions and 2 deletions

View File

@ -135,8 +135,8 @@ func NewComponentGlobalsRegistry() *componentGlobalsRegistry {
}
func (r *componentGlobalsRegistry) Reset() {
r.mutex.RLock()
defer r.mutex.RUnlock()
r.mutex.Lock()
defer r.mutex.Unlock()
r.componentGlobals = make(map[string]*ComponentGlobals)
r.emulationVersionConfig = nil
r.featureGatesConfig = nil