Merge pull request #16839 from spowelljr/oneTunnelPerProfile

tunnel: Allow one tunnel per profile
pull/16863/merge
Medya Ghazizadeh 2023-07-10 11:39:11 -07:00 committed by GitHub
commit 69b009fc59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -76,7 +76,7 @@ var tunnelCmd = &cobra.Command{
}
}
mustLockOrExit()
mustLockOrExit(cname)
defer cleanupLock()
// Tunnel uses the k8s clientset to query the API server for services in the LoadBalancerEmulator.
@ -131,8 +131,8 @@ func cleanupLock() {
}
}
func mustLockOrExit() {
tunnelLockPath := filepath.Join(localpath.MiniPath(), ".tunnel_lock")
func mustLockOrExit(profile string) {
tunnelLockPath := filepath.Join(localpath.Profile(profile), ".tunnel_lock")
lockHandle = fslock.New(tunnelLockPath)
err := lockHandle.TryLock()