Skip to content

Commit

Permalink
Merge pull request #3112 from sankar17/set-restconfig-timeout-30s
Browse files Browse the repository at this point in the history
🌱 Set controller rest config timeout to 30secs
  • Loading branch information
kcp-ci-bot authored Apr 17, 2024
2 parents f79c2d5 + 358d945 commit dcd4a44
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 dcd4a44

Please sign in to comment.