37 Star 407 Fork 74

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
controller.go 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
Aiwantaozi 提交于 2019-01-09 12:03 . Refactor logging
package logging
import (
"context"
"github.com/rancher/rancher/pkg/controllers/user/logging/configsyncer"
"github.com/rancher/rancher/pkg/controllers/user/logging/deployer"
"github.com/rancher/rancher/pkg/controllers/user/logging/watcher"
"github.com/rancher/types/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func Register(ctx context.Context, cluster *config.UserContext) {
clusterName := cluster.ClusterName
secretManager := configsyncer.NewSecretManager(cluster)
clusterLogging := cluster.Management.Management.ClusterLoggings(clusterName)
projectLogging := cluster.Management.Management.ProjectLoggings(metav1.NamespaceAll)
deployer := deployer.NewDeployer(cluster, secretManager)
clusterLogging.AddClusterScopedHandler(ctx, "cluster-logging-deployer", cluster.ClusterName, deployer.ClusterLoggingSync)
projectLogging.AddClusterScopedHandler(ctx, "project-logging-deployer", cluster.ClusterName, deployer.ProjectLoggingSync)
configSyncer := configsyncer.NewConfigSyncer(cluster, secretManager)
clusterLogging.AddClusterScopedHandler(ctx, "cluster-logging-configsyncer", cluster.ClusterName, configSyncer.ClusterLoggingSync)
projectLogging.AddClusterScopedHandler(ctx, "project-logging-configsyncer", cluster.ClusterName, configSyncer.ProjectLoggingSync)
namespaces := cluster.Core.Namespaces(metav1.NamespaceAll)
namespaces.AddClusterScopedHandler(ctx, "namespace-logging-configsysncer", cluster.ClusterName, configSyncer.NamespaceSync)
watcher.StartEndpointWatcher(ctx, cluster)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.5-rc8

搜索帮助