mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Fix hardcoded tmp dir path in kubectl test.
This commit is contained in:
parent
3f6be95f82
commit
42f600870e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user