Commit 42f60087 authored by Dong Liu's avatar Dong Liu

Fix hardcoded tmp dir path in kubectl test.

parent 3f6be95f
......@@ -281,8 +281,11 @@ func TestRefetchSchemaWhenValidationFails(t *testing.T) {
}
}),
}
dir := os.TempDir() + "/schemaCache"
os.RemoveAll(dir)
dir, err := ioutil.TempDir("", "schemaCache")
if err != nil {
t.Fatalf("Error getting tempDir: %v", err)
}
defer os.RemoveAll(dir)
fullDir, err := substituteUserHome(dir)
if err != nil {
......@@ -339,8 +342,11 @@ func TestValidateCachesSchema(t *testing.T) {
}
}),
}
dir := os.TempDir() + "/schemaCache"
os.RemoveAll(dir)
dir, err := ioutil.TempDir("", "schemaCache")
if err != nil {
t.Fatalf("Error getting tempDir: %v", err)
}
defer os.RemoveAll(dir)
obj := &api.Pod{}
data, err := runtime.Encode(testapi.Default.Codec(), obj)
......
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