Fix hardcoded tmp dir path in kubectl test.
This commit is contained in:
@@ -281,8 +281,11 @@ func TestRefetchSchemaWhenValidationFails(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
dir := os.TempDir() + "/schemaCache"
|
dir, err := ioutil.TempDir("", "schemaCache")
|
||||||
os.RemoveAll(dir)
|
if err != nil {
|
||||||
|
t.Fatalf("Error getting tempDir: %v", err)
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(dir)
|
||||||
|
|
||||||
fullDir, err := substituteUserHome(dir)
|
fullDir, err := substituteUserHome(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -339,8 +342,11 @@ func TestValidateCachesSchema(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
dir := os.TempDir() + "/schemaCache"
|
dir, err := ioutil.TempDir("", "schemaCache")
|
||||||
os.RemoveAll(dir)
|
if err != nil {
|
||||||
|
t.Fatalf("Error getting tempDir: %v", err)
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(dir)
|
||||||
|
|
||||||
obj := &api.Pod{}
|
obj := &api.Pod{}
|
||||||
data, err := runtime.Encode(testapi.Default.Codec(), obj)
|
data, err := runtime.Encode(testapi.Default.Codec(), obj)
|
||||||
|
Reference in New Issue
Block a user