代码拉取完成,页面将自动刷新
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)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。