Skip to content

Commit

Permalink
set default LoopbackClientConfig timeout to 30secs
Browse files Browse the repository at this point in the history
Signed-off-by: sankarm <sankarm@vmware.com>
  • Loading branch information
msankara committed Apr 16, 2024
1 parent f79c2d5 commit 358d945
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
_ "net/http/pprof"
"net/url"
"os"
"time"

kcpapiextensionsclientset "github.com/kcp-dev/client-go/apiextensions/client"
kcpapiextensionsinformers "github.com/kcp-dev/client-go/apiextensions/informers"
Expand Down Expand Up @@ -200,6 +201,9 @@ func NewConfig(opts kcpserveroptions.CompletedOptions) (*Config, error) {
return nil, err
}

// Setting the default restConfig timeout to 30 seconds to avoid any client is waiting infinitely
c.GenericConfig.LoopbackClientConfig.Timeout = time.Second * 30

c.KubeClusterClient, err = kcpkubernetesclientset.NewForConfig(rest.CopyConfig(c.GenericConfig.LoopbackClientConfig))
if err != nil {
return nil, err
Expand Down

0 comments on commit 358d945

Please sign in to comment.