mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 04:27:54 +00:00
Fix data race in apiserver mux handler
Signed-off-by: cyclinder <kuocyclinder@gmail.com>
This commit is contained in:
parent
2016fab308
commit
6a194182a1
@ -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
Block a user