mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
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:
commit
09fec90fdc
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user