Bumping k8s dependencies to 1.13
This commit is contained in:
18
vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go
generated
vendored
18
vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go
generated
vendored
@@ -18,12 +18,14 @@ package clientcmd
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/imdario/mergo"
|
||||
|
||||
restclient "k8s.io/client-go/rest"
|
||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
||||
)
|
||||
@@ -243,7 +245,7 @@ func TestCertificateData(t *testing.T) {
|
||||
|
||||
config := clientcmdapi.NewConfig()
|
||||
config.Clusters["clean"] = &clientcmdapi.Cluster{
|
||||
Server: "https://localhost:8443",
|
||||
Server: "https://localhost:8443",
|
||||
CertificateAuthorityData: caData,
|
||||
}
|
||||
config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{
|
||||
@@ -332,7 +334,19 @@ func TestBasicTokenFile(t *testing.T) {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
matchStringArg(token, clientConfig.BearerToken, t)
|
||||
var out *http.Request
|
||||
clientConfig.WrapTransport(fakeTransport(func(req *http.Request) (*http.Response, error) {
|
||||
out = req
|
||||
return &http.Response{}, nil
|
||||
})).RoundTrip(&http.Request{})
|
||||
|
||||
matchStringArg(token, strings.TrimPrefix(out.Header.Get("Authorization"), "Bearer "), t)
|
||||
}
|
||||
|
||||
type fakeTransport func(*http.Request) (*http.Response, error)
|
||||
|
||||
func (ft fakeTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
return ft(req)
|
||||
}
|
||||
|
||||
func TestPrecedenceTokenFile(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user