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
This commit is contained in:
Kubernetes Submit Queue 2017-04-13 22:07:03 -07:00 committed by GitHub
commit 09fec90fdc

View File

@ -1886,8 +1886,12 @@ func LoadConfig() (*restclient.Config, error) {
}
c, err := RestclientConfig(TestContext.KubeContext)
if err != nil {
if TestContext.KubeConfig == "" {
return restclient.InClusterConfig()
} else {
return nil, err
}
}
return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: TestContext.Host}}).ClientConfig()
}