Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
8d853ccb
K
kubesphere
项目概览
水淹萌龙
/
kubesphere
与 Fork 源项目一致
Fork自
KubeSphere / kubesphere
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubesphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8d853ccb
编写于
9月 25, 2019
作者:
J
Jeff
提交者:
zryfish
9月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ks account options
上级
aee01ccd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
3 deletion
+19
-3
cmd/ks-iam/app/options/options.go
cmd/ks-iam/app/options/options.go
+10
-2
cmd/ks-iam/app/server.go
cmd/ks-iam/app/server.go
+9
-1
未找到文件。
cmd/ks-iam/app/options/options.go
浏览文件 @
8d853ccb
...
...
@@ -24,6 +24,8 @@ import (
genericoptions
"kubesphere.io/kubesphere/pkg/server/options"
"kubesphere.io/kubesphere/pkg/simple/client/k8s"
"kubesphere.io/kubesphere/pkg/simple/client/ldap"
"kubesphere.io/kubesphere/pkg/simple/client/mysql"
"kubesphere.io/kubesphere/pkg/simple/client/redis"
"strings"
)
...
...
@@ -31,6 +33,8 @@ type ServerRunOptions struct {
GenericServerRunOptions
*
genericoptions
.
ServerRunOptions
KubernetesOptions
*
k8s
.
KubernetesOptions
LdapOptions
*
ldap
.
LdapOptions
RedisOptions
*
redis
.
RedisOptions
MySQLOptions
*
mysql
.
MySQLOptions
AdminEmail
string
AdminPassword
string
TokenExpireTime
string
...
...
@@ -43,6 +47,8 @@ func NewServerRunOptions() *ServerRunOptions {
GenericServerRunOptions
:
genericoptions
.
NewServerRunOptions
(),
KubernetesOptions
:
k8s
.
NewKubernetesOptions
(),
LdapOptions
:
ldap
.
NewLdapOptions
(),
MySQLOptions
:
mysql
.
NewMySQLOptions
(),
RedisOptions
:
redis
.
NewRedisOptions
(),
}
return
s
}
...
...
@@ -51,15 +57,17 @@ func (s *ServerRunOptions) Flags() (fss cliflag.NamedFlagSets) {
fs
:=
fss
.
FlagSet
(
"generic"
)
s
.
GenericServerRunOptions
.
AddFlags
(
fs
)
fs
.
StringVar
(
&
s
.
AdminEmail
,
"admin-email"
,
"admin@kubesphere.io"
,
"default administrator's email"
)
fs
.
StringVar
(
&
s
.
AdminPassword
,
"admin-password"
,
"passw0rd"
,
"default administrator's password"
)
fs
.
StringVar
(
&
s
.
TokenExpireTime
,
"token-expire-time"
,
"2h"
,
"token expire time,valid time units are
\"
ns
\"
,
\"
us
\"
,
\"
ms
\"
,
\"
s
\"
,
\"
m
\"
,
\"
h
\"
"
)
fs
.
StringVar
(
&
s
.
JWTSecret
,
"jwt-secret"
,
""
,
"jwt secret"
)
fs
.
StringVar
(
&
s
.
AuthRateLimit
,
"auth-rate-limit"
,
"5/30m"
,
"specifies the maximum number of authentication attempts permitted and time interval,valid time units are
\"
s
\"
,
\"
m
\"
,
\"
h
\"
"
)
s
.
GenericServerRunOptions
.
AddFlags
(
fs
)
s
.
KubernetesOptions
.
AddFlags
(
fss
.
FlagSet
(
"kubernetes"
))
s
.
LdapOptions
.
AddFlags
(
fss
.
FlagSet
(
"ldap"
))
s
.
RedisOptions
.
AddFlags
(
fss
.
FlagSet
(
"redis"
))
s
.
MySQLOptions
.
AddFlags
(
fss
.
FlagSet
(
"mysql"
))
kfs
:=
fss
.
FlagSet
(
"klog"
)
local
:=
flag
.
NewFlagSet
(
"klog"
,
flag
.
ExitOnError
)
...
...
cmd/ks-iam/app/server.go
浏览文件 @
8d853ccb
...
...
@@ -85,7 +85,11 @@ cluster's shared state through which all other components interact.`,
func
Run
(
s
*
options
.
ServerRunOptions
,
stopChan
<-
chan
struct
{})
error
{
csop
:=
client
.
NewClientSetOptions
()
csop
.
SetKubernetesOptions
(
s
.
KubernetesOptions
)
.
SetLdapOptions
(
s
.
LdapOptions
)
csop
.
SetKubernetesOptions
(
s
.
KubernetesOptions
)
.
SetLdapOptions
(
s
.
LdapOptions
)
.
SetRedisOptions
(
s
.
RedisOptions
)
.
SetMySQLOptions
(
s
.
MySQLOptions
)
client
.
NewClientSetFactory
(
csop
,
stopChan
)
expireTime
,
err
:=
time
.
ParseDuration
(
s
.
TokenExpireTime
)
...
...
@@ -127,10 +131,14 @@ func Complete(s *options.ServerRunOptions) error {
conf
.
Apply
(
&
apiserverconfig
.
Config
{
KubernetesOptions
:
s
.
KubernetesOptions
,
LdapOptions
:
s
.
LdapOptions
,
RedisOptions
:
s
.
RedisOptions
,
MySQLOptions
:
s
.
MySQLOptions
,
})
s
.
KubernetesOptions
=
conf
.
KubernetesOptions
s
.
LdapOptions
=
conf
.
LdapOptions
s
.
RedisOptions
=
conf
.
RedisOptions
s
.
MySQLOptions
=
conf
.
MySQLOptions
return
nil
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录