mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #67347 from juanvallejo/jvallejo/use-temp-file-config-tests
Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. use temp file for kubeconfig in test Followup to https://github.com/kubernetes/kubernetes/pull/67093 Updates client_config_test to use a temporary file for kubeconfig. **Release note**: ```release-note NONE ``` cc @deads2k @soltysh
This commit is contained in:
commit
46bfa1ab17
@ -132,9 +132,17 @@ func TestModifyContext(t *testing.T) {
|
|||||||
"clean": true,
|
"clean": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tempPath, err := ioutil.TempFile("", "testclientcmd-")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected error: %v", err)
|
||||||
|
}
|
||||||
|
defer os.Remove(tempPath.Name())
|
||||||
|
|
||||||
pathOptions := NewDefaultPathOptions()
|
pathOptions := NewDefaultPathOptions()
|
||||||
config := createValidTestConfig()
|
config := createValidTestConfig()
|
||||||
|
|
||||||
|
pathOptions.GlobalFile = tempPath.Name()
|
||||||
|
|
||||||
// define new context and assign it - our path options config
|
// define new context and assign it - our path options config
|
||||||
config.Contexts["updated"] = &clientcmdapi.Context{
|
config.Contexts["updated"] = &clientcmdapi.Context{
|
||||||
Cluster: "updated",
|
Cluster: "updated",
|
||||||
|
Loading…
Reference in New Issue
Block a user