Fix data race in apiserver mux handler
Signed-off-by: cyclinder <kuocyclinder@gmail.com> Kubernetes-commit: 6a194182a141665cfcb9b03815d77cd1e468d34e
This commit is contained in:
parent
80dc895424
commit
eca9e91401
|
@ -96,9 +96,11 @@ func NewPathRecorderMux(name string) *PathRecorderMux {
|
|||
|
||||
// ListedPaths returns the registered handler exposedPaths.
|
||||
func (m *PathRecorderMux) ListedPaths() []string {
|
||||
m.lock.Lock()
|
||||
handledPaths := append([]string{}, m.exposedPaths...)
|
||||
sort.Strings(handledPaths)
|
||||
m.lock.Unlock()
|
||||
|
||||
sort.Strings(handledPaths)
|
||||
return handledPaths
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue