Unverified Commit 46bfa1ab authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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
parents c65f65cf 03af5089
......@@ -132,9 +132,17 @@ func TestModifyContext(t *testing.T) {
"clean": true,
}
tempPath, err := ioutil.TempFile("", "testclientcmd-")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
defer os.Remove(tempPath.Name())
pathOptions := NewDefaultPathOptions()
config := createValidTestConfig()
pathOptions.GlobalFile = tempPath.Name()
// define new context and assign it - our path options config
config.Contexts["updated"] = &clientcmdapi.Context{
Cluster: "updated",
......
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