@@ -28,7 +28,6 @@ import (
28
28
"github.com/cortexproject/cortex/pkg/util/services"
29
29
cortex_testutil "github.com/cortexproject/cortex/pkg/util/testutil"
30
30
"github.com/cortexproject/cortex/pkg/util/users"
31
- "github.com/cortexproject/cortex/pkg/util/users/tenant"
32
31
)
33
32
34
33
type testBlocksCleanerOptions struct {
@@ -164,15 +163,15 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
164
163
createDeletionMark (t , bucketClient , "user-2" , block7 , now .Add (- deletionDelay ).Add (- time .Hour )) // Block reached the deletion threshold.
165
164
166
165
// 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 ())))
168
167
block9 := createTSDBBlock (t , bucketClient , "user-3" , 10 , 30 , nil )
169
168
block10 := createTSDBBlock (t , bucketClient , "user-3" , 30 , 50 , nil )
170
169
createParquetMarker (t , bucketClient , "user-3" , block10 )
171
170
172
171
// 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 ())
174
173
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 ))
176
175
user4DebugMetaFile := path .Join ("user-4" , block .DebugMetas , "meta.json" )
177
176
require .NoError (t , bucketClient .Upload (context .Background (), user4DebugMetaFile , strings .NewReader ("some random content here" )))
178
177
@@ -270,7 +269,7 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
270
269
{"user-3" , true },
271
270
{"user-4" , options .user4FilesExist },
272
271
} {
273
- exists , err := tenant .TenantDeletionMarkExists (ctx , bucketClient , tc .user )
272
+ exists , err := users .TenantDeletionMarkExists (ctx , bucketClient , tc .user )
274
273
require .NoError (t , err )
275
274
assert .Equal (t , tc .expectedExists , exists , tc .user )
276
275
}
0 commit comments