Force update user list for kubernetes.secrets backend
Signed-off-by: Vitaliy Snurnitsin <vitaliy.snurnitsin@flant.com>
This commit is contained in:
parent
a973b88463
commit
9024405232
1 changed files with 9 additions and 0 deletions
9
main.go
9
main.go
|
@ -248,6 +248,15 @@ type clientStatus struct {
|
||||||
|
|
||||||
func (oAdmin *OvpnAdmin) userListHandler(w http.ResponseWriter, r *http.Request) {
|
func (oAdmin *OvpnAdmin) userListHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Info(r.RemoteAddr, " ", r.RequestURI)
|
log.Info(r.RemoteAddr, " ", r.RequestURI)
|
||||||
|
|
||||||
|
if *storageBackend == "kubernetes.secrets" {
|
||||||
|
err := app.updateIndexTxtOnDisk()
|
||||||
|
if err != nil {
|
||||||
|
log.Errorln(err)
|
||||||
|
}
|
||||||
|
oAdmin.clients = oAdmin.usersList()
|
||||||
|
}
|
||||||
|
|
||||||
usersList, _ := json.Marshal(oAdmin.clients)
|
usersList, _ := json.Marshal(oAdmin.clients)
|
||||||
fmt.Fprintf(w, "%s", usersList)
|
fmt.Fprintf(w, "%s", usersList)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue