-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit refactors the clustermesh subsystem into a cell, which is registered in the controlplane module. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
- Loading branch information
Showing
13 changed files
with
144 additions
and
137 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Cilium | ||
|
||
package clustermesh | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
|
||
"github.com/cilium/cilium/pkg/clustermesh/types" | ||
"github.com/cilium/cilium/pkg/hive/cell" | ||
"github.com/cilium/cilium/pkg/ipcache" | ||
"github.com/cilium/cilium/pkg/k8s" | ||
"github.com/cilium/cilium/pkg/kvstore" | ||
"github.com/cilium/cilium/pkg/kvstore/store" | ||
nodemanager "github.com/cilium/cilium/pkg/node/manager" | ||
nodeStore "github.com/cilium/cilium/pkg/node/store" | ||
"github.com/cilium/cilium/pkg/option" | ||
) | ||
|
||
var Cell = cell.Module( | ||
"clustermesh", | ||
"ClusterMesh is the Cilium multicluster implementation", | ||
|
||
cell.Provide(NewClusterMesh), | ||
|
||
// Convert concrete objects into more restricted interfaces used by clustermesh. | ||
cell.ProvidePrivate(func(sc *k8s.ServiceCache) ServiceMerger { return sc }), | ||
cell.ProvidePrivate(func(ipcache *ipcache.IPCache) ipcache.IPCacher { return ipcache }), | ||
cell.ProvidePrivate(func(mgr nodemanager.NodeManager) (store.Observer, kvstore.ClusterSizeDependantIntervalFunc) { | ||
return nodeStore.NewNodeObserver(mgr), mgr.ClusterSizeDependantInterval | ||
}), | ||
cell.ProvidePrivate(func() store.KeyCreator { return nodeStore.KeyCreator }), | ||
cell.ProvidePrivate(func(cfg *option.DaemonConfig) types.ClusterIDName { | ||
return types.ClusterIDName{ClusterID: cfg.ClusterID, ClusterName: cfg.ClusterName} | ||
}), | ||
|
||
cell.Config(Config{}), | ||
) | ||
|
||
type Config struct { | ||
// ClusterMeshConfig is the path to the clustermesh configuration directory. | ||
ClusterMeshConfig string | ||
} | ||
|
||
func (def Config) Flags(flags *pflag.FlagSet) { | ||
flags.String("clustermesh-config", def.ClusterMeshConfig, "Path to the ClusterMesh configuration directory") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.