cleanup, ensure haproxy is running and disallow writes to followers

This commit is contained in:
ston1th 2021-10-09 19:03:08 +02:00
commit fef86deac8
9 changed files with 49 additions and 183 deletions

View file

@ -104,8 +104,9 @@ func NewServer(c *config.Config, log logr.Logger) (*Server, error) {
return s, nil
}
func (s *Server) UpdateDB(db *db.DB) error {
func (s *Server) UpdateDB(db *db.DB, leader bool) error {
s.Data.DB = db
s.Data.Leader = leader
if s.Data.Net == nil {
na, err := netalloc.NewGenericAlloc(db, s.cidr)
if err != nil {