mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
hotfix: set get running pod timeout 10s to 5s (#494)
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/wencaiwulue/kubevpn/v2/pkg/config"
|
||||
plog "github.com/wencaiwulue/kubevpn/v2/pkg/log"
|
||||
"github.com/wencaiwulue/kubevpn/v2/pkg/util"
|
||||
|
||||
@@ -296,8 +296,8 @@ func (c *ConnectOptions) portForward(ctx context.Context, portPair []string) err
|
||||
|
||||
sortBy := func(pods []*v1.Pod) sort.Interface { return sort.Reverse(podutils.ActivePods(pods)) }
|
||||
label := fields.OneTermEqualSelector("app", config.ConfigMapPodTrafficManager).String()
|
||||
_, _, _ = polymorphichelpers.GetFirstPod(c.clientset.CoreV1(), c.Namespace, label, time.Second*10, sortBy)
|
||||
ctx2, cancelFunc2 := context.WithTimeout(ctx, time.Second*10)
|
||||
_, _, _ = polymorphichelpers.GetFirstPod(c.clientset.CoreV1(), c.Namespace, label, time.Second*5, sortBy)
|
||||
ctx2, cancelFunc2 := context.WithTimeout(ctx, time.Second*5)
|
||||
defer cancelFunc2()
|
||||
podList, err := c.GetRunningPodList(ctx2)
|
||||
if err != nil {
|
||||
|
||||
@@ -335,7 +335,7 @@ func CheckPodStatus(ctx context.Context, cancelFunc context.CancelFunc, podName
|
||||
return err != nil
|
||||
},
|
||||
func() error {
|
||||
ctx1, cancelFunc1 := context.WithTimeout(ctx, time.Second*10)
|
||||
ctx1, cancelFunc1 := context.WithTimeout(ctx, time.Second*5)
|
||||
defer cancelFunc1()
|
||||
_, err := podInterface.Get(ctx1, podName, v1.GetOptions{})
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user