mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
kubelet/userns: Use t.TempDir()
These tests will create the userns record mapping file, so let's use a temporal directory for that. Without specifying one, by mistake we were using the "/tmp/non-existant-dir.This-is-not-used-in-tests/" directory. Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
parent
0f7b9cc4f5
commit
a56d483df0
@ -297,6 +297,7 @@ func TestCleanupOrphanedPodUsernsAllocations(t *testing.T) {
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
testUserNsPodsManager := &testUserNsPodsManager{
|
||||
podDir: t.TempDir(),
|
||||
podList: tc.listPods,
|
||||
}
|
||||
m, err := MakeUserNsManager(testUserNsPodsManager)
|
||||
|
Loading…
Reference in New Issue
Block a user