Merge pull request #199 from flant/update-user-list-in-ha-mode

Fix update user list for kubernetes.secrets backend
This commit is contained in:
vitaliy-sn 2023-04-27 16:04:00 +03:00 committed by GitHub
commit f4d0212bfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

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)
}