37 Star 403 Fork 75

GVPrancher/rancher

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
controller.go 1.49 KB
Copy Edit Raw Blame History
Aiwantaozi authored 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.13

Search