Commit 09fec90f authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #44424 from timothysc/in-cluster-config-e2e

Automatic merge from submit-queue (batch tested with PRs 44424, 44026, 43939, 44386, 42914) Try in cluster config when input KubeConfig is empty **What this PR does / why we need it**: Allows for downstream providers to run e2es "incluster" sans kubeconfig **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ``` NONE ``` /cc @kubernetes/sig-testing-pr-reviews @marun
parents ad964e71 d401627a
...@@ -1886,8 +1886,12 @@ func LoadConfig() (*restclient.Config, error) { ...@@ -1886,8 +1886,12 @@ func LoadConfig() (*restclient.Config, error) {
} }
c, err := RestclientConfig(TestContext.KubeContext) c, err := RestclientConfig(TestContext.KubeContext)
if err != nil { if err != nil {
if TestContext.KubeConfig == "" {
return restclient.InClusterConfig()
} else {
return nil, err return nil, err
} }
}
return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: TestContext.Host}}).ClientConfig() return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: TestContext.Host}}).ClientConfig()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment