Skip to content

Commit

Permalink
keystone: config: SetModelManager for whitelisted config
Browse files Browse the repository at this point in the history
To quash avoid informer error "virtual object is nil"
  • Loading branch information
yousong committed Jun 21, 2020
1 parent 2f79c99 commit 7d47ac4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pkg/keystone/models/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,18 @@ func getConfigOptions(conf api.TConfigs, model db.IModel, sensitiveList map[stri
sensitive := make(TConfigOptions, 0)
for group, groupConf := range conf {
for optKey, optVal := range groupConf {
opt := SConfigOption{}
opt.ResType = model.Keyword()
opt.ResId = model.GetId()
opt.Group = group
opt.Option = optKey
opt.Value = optVal
opt := &SConfigOption{
ResType: model.Keyword(),
ResId: model.GetId(),
Group: group,
Option: optKey,
Value: optVal,
}
opt.SetModelManager(WhitelistedConfigManager, opt)
if v, ok := sensitiveList[group]; ok && utils.IsInStringArray(optKey, v) {
sensitive = append(sensitive, opt)
sensitive = append(sensitive, *opt)
} else {
options = append(options, opt)
options = append(options, *opt)
}
}
}
Expand Down

0 comments on commit 7d47ac4

Please sign in to comment.