diff --git a/pkg/server/config.go b/pkg/server/config.go index ed57a8bba7f..b94dccb194b 100644 --- a/pkg/server/config.go +++ b/pkg/server/config.go @@ -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" @@ -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