forked from coop-cloud/abra
fix: load timeout before other opts
This commit is contained in:
parent
6d4ee3de0d
commit
7a5ad65178
@ -14,6 +14,8 @@ import (
|
|||||||
func New(contextName string) (*client.Client, error) {
|
func New(contextName string) (*client.Client, error) {
|
||||||
var clientOpts []client.Opt
|
var clientOpts []client.Opt
|
||||||
|
|
||||||
|
clientOpts = append(clientOpts, client.WithTimeout(3*time.Second))
|
||||||
|
|
||||||
if contextName != "default" {
|
if contextName != "default" {
|
||||||
context, err := GetContext(contextName)
|
context, err := GetContext(contextName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -47,8 +49,6 @@ func New(contextName string) (*client.Client, error) {
|
|||||||
clientOpts = append(clientOpts, client.WithAPIVersionNegotiation())
|
clientOpts = append(clientOpts, client.WithAPIVersionNegotiation())
|
||||||
}
|
}
|
||||||
|
|
||||||
clientOpts = append(clientOpts, client.WithTimeout(3*time.Second))
|
|
||||||
|
|
||||||
cl, err := client.NewClientWithOpts(clientOpts...)
|
cl, err := client.NewClientWithOpts(clientOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user