fix: set default request timeout to 120 seconds (#3253)
Signed-off-by: Max Xu <xuhuan@live.cn> Co-authored-by: Fernand Galiana <fernand.galiana@gmail.com>mine
parent
445230640a
commit
fbd2a0250a
13
cmd/root.go
13
cmd/root.go
|
|
@ -12,17 +12,18 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/lmittmann/tint"
|
||||
"github.com/mattn/go-colorable"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
"k8s.io/client-go/tools/clientcmd/api"
|
||||
|
||||
"github.com/derailed/k9s/internal/client"
|
||||
"github.com/derailed/k9s/internal/color"
|
||||
"github.com/derailed/k9s/internal/config"
|
||||
"github.com/derailed/k9s/internal/config/data"
|
||||
"github.com/derailed/k9s/internal/slogs"
|
||||
"github.com/derailed/k9s/internal/view"
|
||||
"github.com/lmittmann/tint"
|
||||
"github.com/mattn/go-colorable"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
"k8s.io/client-go/tools/clientcmd/api"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -269,7 +270,7 @@ func initK8sFlags() {
|
|||
rootCmd.Flags().StringVar(
|
||||
k8sFlags.Timeout,
|
||||
"request-timeout",
|
||||
"5s",
|
||||
"",
|
||||
"The length of time to wait before giving up on a single server request",
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@ import (
|
|||
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
clientcmd "k8s.io/client-go/tools/clientcmd"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"k8s.io/client-go/tools/clientcmd/api"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultCallTimeoutDuration time.Duration = 10 * time.Second
|
||||
defaultCallTimeoutDuration = 120 * time.Second
|
||||
|
||||
// UsePersistentConfig caches client config to avoid reloads.
|
||||
UsePersistentConfig = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue