mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-09-08 11:58:51 +00:00
Bump up go-client to fix auth plugin panic (#281)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@@ -75,10 +76,12 @@ func queryNamespaces(kc *kubeconfig.Kubeconfig) ([]string, error) {
|
||||
var out []string
|
||||
var next string
|
||||
for {
|
||||
list, err := clientset.CoreV1().Namespaces().List(metav1.ListOptions{
|
||||
Limit: 500,
|
||||
Continue: next,
|
||||
})
|
||||
list, err := clientset.CoreV1().Namespaces().List(
|
||||
context.Background(),
|
||||
metav1.ListOptions{
|
||||
Limit: 500,
|
||||
Continue: next,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to list namespaces from k8s API")
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
@@ -101,7 +102,7 @@ func namespaceExists(kc *kubeconfig.Kubeconfig, ns string) (bool, error) {
|
||||
return false, errors.Wrap(err, "failed to initialize k8s REST client")
|
||||
}
|
||||
|
||||
namespace, err := clientset.CoreV1().Namespaces().Get(ns, metav1.GetOptions{})
|
||||
namespace, err := clientset.CoreV1().Namespaces().Get(context.Background(), ns, metav1.GetOptions{})
|
||||
if errors2.IsNotFound(err) {
|
||||
return false, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user