From 7a5ad651781ac2ef1404f3ce4ce33c3fe04ad313 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Thu, 21 Oct 2021 15:06:03 +0200 Subject: [PATCH] fix: load timeout before other opts --- pkg/client/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/client/client.go b/pkg/client/client.go index 2c595569..fcd33899 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -14,6 +14,8 @@ import ( func New(contextName string) (*client.Client, error) { var clientOpts []client.Opt + clientOpts = append(clientOpts, client.WithTimeout(3*time.Second)) + if contextName != "default" { context, err := GetContext(contextName) if err != nil { @@ -47,8 +49,6 @@ func New(contextName string) (*client.Client, error) { clientOpts = append(clientOpts, client.WithAPIVersionNegotiation()) } - clientOpts = append(clientOpts, client.WithTimeout(3*time.Second)) - cl, err := client.NewClientWithOpts(clientOpts...) if err != nil { return nil, err