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:
		@@ -297,6 +297,7 @@ func TestCleanupOrphanedPodUsernsAllocations(t *testing.T) {
 | 
				
			|||||||
	for _, tc := range cases {
 | 
						for _, tc := range cases {
 | 
				
			||||||
		t.Run(tc.name, func(t *testing.T) {
 | 
							t.Run(tc.name, func(t *testing.T) {
 | 
				
			||||||
			testUserNsPodsManager := &testUserNsPodsManager{
 | 
								testUserNsPodsManager := &testUserNsPodsManager{
 | 
				
			||||||
 | 
									podDir:  t.TempDir(),
 | 
				
			||||||
				podList: tc.listPods,
 | 
									podList: tc.listPods,
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			m, err := MakeUserNsManager(testUserNsPodsManager)
 | 
								m, err := MakeUserNsManager(testUserNsPodsManager)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user