37 Star 407 Fork 74

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
register.go 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
Max Korp 提交于 2018-12-17 12:01 . Fix several auth refresh bugs.
package auth
import (
"context"
"github.com/rancher/types/config"
)
func RegisterEarly(ctx context.Context, management *config.ManagementContext) {
prtb, crtb := newRTBLifecycles(management)
gr := newGlobalRoleLifecycle(management)
grb := newGlobalRoleBindingLifecycle(management)
p, c := newPandCLifecycles(management)
u := newUserLifecycle(management)
n := newTokenController(management)
ua := newUserAttributeController(management)
s := newAuthSettingController(management)
management.Management.ProjectRoleTemplateBindings("").AddLifecycle(ctx, ptrbMGMTController, prtb)
management.Management.ClusterRoleTemplateBindings("").AddLifecycle(ctx, ctrbMGMTController, crtb)
management.Management.GlobalRoles("").AddLifecycle(ctx, grController, gr)
management.Management.GlobalRoleBindings("").AddLifecycle(ctx, grbController, grb)
management.Management.Projects("").AddHandler(ctx, projectCreateController, p.sync)
management.Management.Clusters("").AddHandler(ctx, clusterCreateController, c.sync)
management.Management.Users("").AddLifecycle(ctx, userController, u)
management.Management.Tokens("").AddHandler(ctx, tokenController, n.sync)
management.Management.UserAttributes("").AddHandler(ctx, userAttributeController, ua.sync)
management.Management.Settings("").AddHandler(ctx, authSettingController, s.sync)
}
func RegisterLate(ctx context.Context, management *config.ManagementContext) {
p, c := newPandCLifecycles(management)
management.Management.Projects("").AddLifecycle(ctx, projectRemoveController, p)
management.Management.Clusters("").AddLifecycle(ctx, clusterRemoveController, c)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.1-rc1

搜索帮助