mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Get rid of un-needed lock
This commit is contained in:
parent
a559d8d9b2
commit
dd9c562769
@ -347,15 +347,10 @@ func (proxier *Proxier) setServiceInfo(service string, info *serviceInfo) {
|
|||||||
proxier.serviceMap[service] = info
|
proxier.serviceMap[service] = info
|
||||||
}
|
}
|
||||||
|
|
||||||
// used to globally lock around unused ports. Only used in testing.
|
|
||||||
var unusedPortLock sync.Mutex
|
|
||||||
|
|
||||||
// addServiceOnUnusedPort starts listening for a new service, returning the
|
// addServiceOnUnusedPort starts listening for a new service, returning the
|
||||||
// port it's using. For testing on a system with unknown ports used. The timeout only applies to UDP
|
// port it's using. For testing on a system with unknown ports used. The timeout only applies to UDP
|
||||||
// connections, for now.
|
// connections, for now.
|
||||||
func (proxier *Proxier) addServiceOnUnusedPort(service, protocol string, timeout time.Duration) (string, error) {
|
func (proxier *Proxier) addServiceOnUnusedPort(service, protocol string, timeout time.Duration) (string, error) {
|
||||||
unusedPortLock.Lock()
|
|
||||||
defer unusedPortLock.Unlock()
|
|
||||||
sock, err := newProxySocket(protocol, proxier.address, 0)
|
sock, err := newProxySocket(protocol, proxier.address, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
Loading…
Reference in New Issue
Block a user