1
0
mirror of https://github.com/flant/ovpn-admin.git synced 2025-01-05 10:40:52 +02:00

Force update user list for kubernetes.secrets backend

Signed-off-by: Vitaliy Snurnitsin <vitaliy.snurnitsin@flant.com>
This commit is contained in:
Vitaliy Snurnitsin 2023-04-27 09:38:01 +03:00
parent a973b88463
commit 9024405232

View File

@ -248,6 +248,15 @@ type clientStatus struct {
func (oAdmin *OvpnAdmin) userListHandler(w http.ResponseWriter, r *http.Request) {
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)
fmt.Fprintf(w, "%s", usersList)
}