Bump up go-client to fix auth plugin panic (#281)

This commit is contained in:
Andrey Viktorov
2021-02-03 01:38:27 +02:00
committed by GitHub
parent 767218a9a6
commit 9b4aea3b59
4 changed files with 303 additions and 87 deletions

View File

@@ -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")
}

View File

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