Skip to content

Commit 30f5c6a

Browse files
everpeacethaJeztah
authored andcommitted
Use t.TempDir instead of os.MkdirTemp
Signed-off-by: Shingo Omura <[email protected]> (cherry picked from commit 05bb52b) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 59d8363 commit 30f5c6a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

pkg/cri/server/container_create_linux_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,11 +1339,7 @@ alice:x:1000:
13391339
additional-group-for-alice:x:11111:alice
13401340
additional-group-for-root:x:22222:root
13411341
`
1342-
tempRootDir, err := os.MkdirTemp("", "TestContainerUser-")
1343-
require.NoError(t, err)
1344-
if tempRootDir != "" {
1345-
defer os.RemoveAll(tempRootDir)
1346-
}
1342+
tempRootDir := t.TempDir()
13471343
require.NoError(t,
13481344
os.MkdirAll(filepath.Join(tempRootDir, "etc"), 0755),
13491345
)

0 commit comments

Comments
 (0)