@@ -28,7 +28,6 @@ import (
2828 "github.com/cortexproject/cortex/pkg/util/services"
2929 cortex_testutil "github.com/cortexproject/cortex/pkg/util/testutil"
3030 "github.com/cortexproject/cortex/pkg/util/users"
31- "github.com/cortexproject/cortex/pkg/util/users/tenant"
3231)
3332
3433type testBlocksCleanerOptions struct {
@@ -164,15 +163,15 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
164163 createDeletionMark (t , bucketClient , "user-2" , block7 , now .Add (- deletionDelay ).Add (- time .Hour )) // Block reached the deletion threshold.
165164
166165 // Blocks for user-3, tenant marked for deletion.
167- require .NoError (t , tenant .WriteTenantDeletionMark (context .Background (), bucketClient , "user-3" , tenant .NewTenantDeletionMark (time .Now ())))
166+ require .NoError (t , users .WriteTenantDeletionMark (context .Background (), bucketClient , "user-3" , users .NewTenantDeletionMark (time .Now ())))
168167 block9 := createTSDBBlock (t , bucketClient , "user-3" , 10 , 30 , nil )
169168 block10 := createTSDBBlock (t , bucketClient , "user-3" , 30 , 50 , nil )
170169 createParquetMarker (t , bucketClient , "user-3" , block10 )
171170
172171 // User-4 with no more blocks, but couple of mark and debug files. Should be fully deleted.
173- user4Mark := tenant .NewTenantDeletionMark (time .Now ())
172+ user4Mark := users .NewTenantDeletionMark (time .Now ())
174173 user4Mark .FinishedTime = time .Now ().Unix () - 60 // Set to check final user cleanup.
175- require .NoError (t , tenant .WriteTenantDeletionMark (context .Background (), bucketClient , "user-4" , user4Mark ))
174+ require .NoError (t , users .WriteTenantDeletionMark (context .Background (), bucketClient , "user-4" , user4Mark ))
176175 user4DebugMetaFile := path .Join ("user-4" , block .DebugMetas , "meta.json" )
177176 require .NoError (t , bucketClient .Upload (context .Background (), user4DebugMetaFile , strings .NewReader ("some random content here" )))
178177
@@ -270,7 +269,7 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
270269 {"user-3" , true },
271270 {"user-4" , options .user4FilesExist },
272271 } {
273- exists , err := tenant .TenantDeletionMarkExists (ctx , bucketClient , tc .user )
272+ exists , err := users .TenantDeletionMarkExists (ctx , bucketClient , tc .user )
274273 require .NoError (t , err )
275274 assert .Equal (t , tc .expectedExists , exists , tc .user )
276275 }
0 commit comments