mirror of
https://github.com/minio/minio.git
synced 2025-07-16 04:11:51 -04:00
fix: panic for TestListObjectsWithILM (#21322)
This commit is contained in:
parent
9f24ca5d66
commit
ea77bcfc98
@ -1938,6 +1938,10 @@ func TestListObjectsWithILM(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testListObjectsWithILM(obj ObjectLayer, instanceType string, t1 TestErrHandler) {
|
func testListObjectsWithILM(obj ObjectLayer, instanceType string, t1 TestErrHandler) {
|
||||||
|
// Prepare lifecycle expiration workers
|
||||||
|
es := newExpiryState(t1.Context(), obj, 0)
|
||||||
|
globalExpiryState = es
|
||||||
|
|
||||||
t, _ := t1.(*testing.T)
|
t, _ := t1.(*testing.T)
|
||||||
|
|
||||||
objContent := "test-content"
|
objContent := "test-content"
|
||||||
@ -1977,7 +1981,12 @@ func testListObjectsWithILM(obj ObjectLayer, instanceType string, t1 TestErrHand
|
|||||||
t.Fatalf("%s : %s", instanceType, err.Error())
|
t.Fatalf("%s : %s", instanceType, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
globalBucketMetadataSys.Set(upload.bucket, BucketMetadata{lifecycleConfig: lifecycleConfig})
|
metadata, err := globalBucketMetadataSys.Get(upload.bucket)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
metadata.lifecycleConfig = lifecycleConfig
|
||||||
|
globalBucketMetadataSys.Set(upload.bucket, metadata)
|
||||||
defer globalBucketMetadataSys.Remove(upload.bucket)
|
defer globalBucketMetadataSys.Remove(upload.bucket)
|
||||||
|
|
||||||
// Upload objects which modtime as one week ago, supposed to be expired by ILM
|
// Upload objects which modtime as one week ago, supposed to be expired by ILM
|
||||||
|
@ -452,7 +452,9 @@ func initAllSubsystems(ctx context.Context) {
|
|||||||
globalNotificationSys = NewNotificationSys(globalEndpoints)
|
globalNotificationSys = NewNotificationSys(globalEndpoints)
|
||||||
|
|
||||||
// Create new notification system
|
// Create new notification system
|
||||||
|
if globalEventNotifier == nil {
|
||||||
globalEventNotifier = NewEventNotifier(GlobalContext)
|
globalEventNotifier = NewEventNotifier(GlobalContext)
|
||||||
|
}
|
||||||
|
|
||||||
// Create new bucket metadata system.
|
// Create new bucket metadata system.
|
||||||
if globalBucketMetadataSys == nil {
|
if globalBucketMetadataSys == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user