fix: load timeout before other opts
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2021-10-21 15:06:03 +02:00
parent 6d4ee3de0d
commit 7a5ad65178
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 2 additions and 2 deletions

View File

@ -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