Repository navigation
Expand file tree
/
Copy pathsingleton.go
More file actions
62 lines (59 loc) · 2.54 KB
/
Copy pathsingleton.go
File metadata and controls
62 lines (59 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package pruning
import (
alertDatastore "github.com/stackrox/rox/central/alert/datastore"
blobDS "github.com/stackrox/rox/central/blob/datastore"
clusterDatastore "github.com/stackrox/rox/central/cluster/datastore"
configDatastore "github.com/stackrox/rox/central/config/datastore"
nodeCVEDS "github.com/stackrox/rox/central/cve/node/datastore"
deploymentDatastore "github.com/stackrox/rox/central/deployment/datastore"
imagesDatastore "github.com/stackrox/rox/central/image/datastore"
imageV2Datastore "github.com/stackrox/rox/central/imagev2/datastore"
logimbueStore "github.com/stackrox/rox/central/logimbue/store"
networkFlowsDataStore "github.com/stackrox/rox/central/networkgraph/flow/datastore"
nodeDatastore "github.com/stackrox/rox/central/node/datastore"
podDatastore "github.com/stackrox/rox/central/pod/datastore"
processBaselineDatastore "github.com/stackrox/rox/central/processbaseline/datastore"
processDatastore "github.com/stackrox/rox/central/processindicator/datastore"
plopDataStore "github.com/stackrox/rox/central/processlisteningonport/datastore"
k8sRoleDataStore "github.com/stackrox/rox/central/rbac/k8srole/datastore"
k8srolebindingStore "github.com/stackrox/rox/central/rbac/k8srolebinding/datastore"
snapshotDataStore "github.com/stackrox/rox/central/reports/snapshot/datastore"
riskDataStore "github.com/stackrox/rox/central/risk/datastore"
roleDataStore "github.com/stackrox/rox/central/role/datastore"
serviceAccountDataStore "github.com/stackrox/rox/central/serviceaccount/datastore"
vulnReqDataStore "github.com/stackrox/rox/central/vulnmgmt/vulnerabilityrequest/datastore"
"github.com/stackrox/rox/pkg/sync"
)
var (
once sync.Once
gc GarbageCollector
)
// Singleton returns the global instance of the garbage collection
func Singleton() GarbageCollector {
once.Do(func() {
gc = newGarbageCollector(alertDatastore.Singleton(),
nodeDatastore.Singleton(),
imagesDatastore.Singleton(),
imageV2Datastore.Singleton(),
clusterDatastore.Singleton(),
deploymentDatastore.Singleton(),
podDatastore.Singleton(),
processDatastore.Singleton(),
processBaselineDatastore.Singleton(),
networkFlowsDataStore.Singleton(),
configDatastore.Singleton(),
riskDataStore.Singleton(),
vulnReqDataStore.Singleton(),
serviceAccountDataStore.Singleton(),
k8sRoleDataStore.Singleton(),
k8srolebindingStore.Singleton(),
logimbueStore.Singleton(),
snapshotDataStore.Singleton(),
plopDataStore.Singleton(),
blobDS.Singleton(),
nodeCVEDS.Singleton(),
roleDataStore.Singleton(),
)
})
return gc
}