github.com/cilium/cilium@v1.16.2/pkg/clustermesh/cell.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package clustermesh 5 6 import ( 7 "github.com/cilium/hive/cell" 8 9 "github.com/cilium/cilium/pkg/clustermesh/common" 10 "github.com/cilium/cilium/pkg/clustermesh/wait" 11 "github.com/cilium/cilium/pkg/ipcache" 12 "github.com/cilium/cilium/pkg/k8s" 13 "github.com/cilium/cilium/pkg/kvstore" 14 "github.com/cilium/cilium/pkg/metrics" 15 nodemanager "github.com/cilium/cilium/pkg/node/manager" 16 nodeStore "github.com/cilium/cilium/pkg/node/store" 17 ) 18 19 var Cell = cell.Module( 20 "clustermesh", 21 "ClusterMesh is the Cilium multicluster implementation", 22 23 cell.Provide(NewClusterMesh), 24 25 // Convert concrete objects into more restricted interfaces used by clustermesh. 26 cell.ProvidePrivate(func(sc *k8s.ServiceCache) ServiceMerger { return sc }), 27 cell.ProvidePrivate(func(ipcache *ipcache.IPCache) ipcache.IPCacher { return ipcache }), 28 cell.ProvidePrivate(func(mgr nodemanager.NodeManager) (nodeStore.NodeManager, kvstore.ClusterSizeDependantIntervalFunc) { 29 return mgr, mgr.ClusterSizeDependantInterval 30 }), 31 cell.ProvidePrivate(idsMgrProvider), 32 33 cell.Config(common.Config{}), 34 cell.Config(wait.TimeoutConfigDefault), 35 36 metrics.Metric(NewMetrics), 37 metrics.Metric(common.MetricsProvider(subsystem)), 38 39 cell.Invoke(ipsetNotifier), 40 cell.Invoke(nodeManagerNotifier), 41 )