mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-05 00:51:02 +00:00
Allocate map when out points to nil map
Kubernetes-commit: 53080bda9c95db33227b02b5b7df7e7737a2904e
This commit is contained in:
committed by
Kubernetes Publisher
parent
a32a6f7a30
commit
efe42e9182
@@ -80,6 +80,32 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func TestNilOutMap(t *testing.T) {
|
||||
var fakeKubeconfigData = `apiVersion: v1
|
||||
kind: Config
|
||||
clusters:
|
||||
- cluster:
|
||||
certificate-authority-data: UEhPTlkK
|
||||
server: https://1.1.1.1
|
||||
name: production
|
||||
contexts:
|
||||
- context:
|
||||
cluster: production
|
||||
user: production
|
||||
name: production
|
||||
current-context: production
|
||||
users:
|
||||
- name: production
|
||||
user:
|
||||
auth-provider:
|
||||
name: gcp`
|
||||
|
||||
_, _, err := clientcmdlatest.Codec.Decode([]byte(fakeKubeconfigData), nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNonExistentCommandLineFile(t *testing.T) {
|
||||
loadingRules := ClientConfigLoadingRules{
|
||||
ExplicitPath: "bogus_file",
|
||||
|
Reference in New Issue
Block a user