Skip to content

Commit 9b4aea3

Browse files
authored
Bump up go-client to fix auth plugin panic (#281)
1 parent 767218a commit 9b4aea3

File tree

4 files changed

+303
-87
lines changed

4 files changed

+303
-87
lines changed

cmd/kubens/list.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package main
1616

1717
import (
18+
"context"
1819
"fmt"
1920
"io"
2021
"os"
@@ -75,10 +76,12 @@ func queryNamespaces(kc *kubeconfig.Kubeconfig) ([]string, error) {
7576
var out []string
7677
var next string
7778
for {
78-
list, err := clientset.CoreV1().Namespaces().List(metav1.ListOptions{
79-
Limit: 500,
80-
Continue: next,
81-
})
79+
list, err := clientset.CoreV1().Namespaces().List(
80+
context.Background(),
81+
metav1.ListOptions{
82+
Limit: 500,
83+
Continue: next,
84+
})
8285
if err != nil {
8386
return nil, errors.Wrap(err, "failed to list namespaces from k8s API")
8487
}

cmd/kubens/switch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package main
1616

1717
import (
18+
"context"
1819
"io"
1920
"os"
2021

@@ -101,7 +102,7 @@ func namespaceExists(kc *kubeconfig.Kubeconfig, ns string) (bool, error) {
101102
return false, errors.Wrap(err, "failed to initialize k8s REST client")
102103
}
103104

104-
namespace, err := clientset.CoreV1().Namespaces().Get(ns, metav1.GetOptions{})
105+
namespace, err := clientset.CoreV1().Namespaces().Get(context.Background(), ns, metav1.GetOptions{})
105106
if errors2.IsNotFound(err) {
106107
return false, nil
107108
}

go.mod

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,11 @@ go 1.14
55
require (
66
facette.io/natsort v0.0.0-20181210072756-2cd4dd1e2dcb
77
github.com/fatih/color v1.9.0
8-
github.com/gogo/protobuf v1.3.1 // indirect
9-
github.com/google/go-cmp v0.4.0
10-
github.com/google/gofuzz v1.1.0 // indirect
11-
github.com/googleapis/gnostic v0.1.0 // indirect
8+
github.com/google/go-cmp v0.5.2
129
github.com/imdario/mergo v0.3.9 // indirect
1310
github.com/mattn/go-isatty v0.0.12
1411
github.com/pkg/errors v0.9.1
15-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
16-
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
1712
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
18-
k8s.io/apimachinery v0.17.0
19-
k8s.io/client-go v0.17.0
20-
k8s.io/utils v0.0.0-20200414100711-2df71ebbae66 // indirect
21-
sigs.k8s.io/yaml v1.2.0 // indirect
13+
k8s.io/apimachinery v0.21.0-alpha.1
14+
k8s.io/client-go v0.21.0-alpha.1
2215
)

0 commit comments

Comments
 (0)