Skip to content

Commit

Permalink
fix(installer): generate admin password value wrongly (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
wl-chen authored Apr 1, 2022
1 parent 6abe23f commit 3e94139
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Binary file modified charts/bin/gen
Binary file not shown.
9 changes: 7 additions & 2 deletions charts/values/generateChartValues.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,15 @@ func (customConfig *CustomConfig) GenerateAuthChartValuesYaml(oIDCClientSecret s
if len(originAuthCustomConfig.Controller.Image) == 0 {
return errors.New("auth custom config api image nil")
}
if len(originAuthCustomConfig.Controller.AdminUsername) == 0 {
if len(originAuthCustomConfig.Controller.AdminUsername) == 0 && len(originAuthCustomConfig.Controller.AdminPassword) == 0 {
originAuthCustomConfig.Controller.AdminUsername = "admin"
originAuthCustomConfig.Controller.AdminPassword = base64.StdEncoding.EncodeToString([]byte(originAuthCustomConfig.Controller.AdminUsername))
} else if len(originAuthCustomConfig.Controller.AdminUsername) == 0 {
return errors.New("auth controller admin userName empty when admin password exists")
} else if len(originAuthCustomConfig.Controller.AdminPassword) == 0 {
return errors.New("auth controller admin password empty when admin userName exists")
}
originAuthCustomConfig.Controller.AdminPassword = base64.StdEncoding.EncodeToString([]byte(originAuthCustomConfig.Controller.AdminUsername))

obj.TKEAuth = *originAuthCustomConfig

bytes, errMarshal := yaml.Marshal(obj)
Expand Down

0 comments on commit 3e94139

Please sign in to comment.