mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Try in cluster config when input KubeConfig is empty
This commit is contained in:
parent
7a1687dc93
commit
d401627a10
@ -1886,7 +1886,11 @@ func LoadConfig() (*restclient.Config, error) {
|
||||
}
|
||||
c, err := RestclientConfig(TestContext.KubeContext)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if TestContext.KubeConfig == "" {
|
||||
return restclient.InClusterConfig()
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: TestContext.Host}}).ClientConfig()
|
||||
|
Loading…
Reference in New Issue
Block a user