37 Star 411 Fork 76

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setting.go 938 Bytes
一键复制 编辑 原始数据 按行查看 历史
Dan Ramich 提交于 2019-06-12 13:38 . goimport linting changes
package auth
import (
"github.com/rancher/rancher/pkg/auth/providerrefresh"
v3 "github.com/rancher/types/apis/management.cattle.io/v3"
"github.com/rancher/types/config"
"k8s.io/apimachinery/pkg/runtime"
)
const (
authSettingController = "mgmt-auth-settings-controller"
)
type SettingController struct {
settings v3.SettingInterface
}
func newAuthSettingController(mgmt *config.ManagementContext) *SettingController {
n := &SettingController{
settings: mgmt.Management.Settings(""),
}
return n
}
//sync is called periodically and on real updates
func (n *SettingController) sync(key string, obj *v3.Setting) (runtime.Object, error) {
if obj == nil || obj.DeletionTimestamp != nil {
return nil, nil
}
switch obj.Name {
case "auth-user-info-resync-cron":
providerrefresh.UpdateRefreshCronTime(obj.Value)
case "auth-user-info-max-age-seconds":
providerrefresh.UpdateRefreshMaxAge(obj.Value)
}
return nil, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.5

搜索帮助

0d507c66 1850385 C8b1a773 1850385