implemented api handlers
This commit is contained in:
parent
ab12dd67d4
commit
372915e24d
15 changed files with 302 additions and 73 deletions
|
|
@ -51,16 +51,22 @@ func NewLBController(cfg *config.Config, srv *api.Server, log logr.Logger) (call
|
|||
continue
|
||||
}
|
||||
addIPs(cc, n, ips)
|
||||
|
||||
// TODO
|
||||
//cfg, err := cc.Get("config")
|
||||
//if err != nil {
|
||||
// cc.Error(err, "error getting config key")
|
||||
// <-t.C
|
||||
// continue
|
||||
//}
|
||||
var lbs haproxy.Config
|
||||
err = ha.UpdateConfig(ctx, lbs)
|
||||
// deleted LB IPs need to be removed
|
||||
|
||||
lbs, err := db.GetLBs("")
|
||||
if err != nil && err != cluster.ErrPrefixNotFound {
|
||||
cc.Error(err, "error reading lb list")
|
||||
<-t.C
|
||||
continue
|
||||
}
|
||||
lbcfg, err := haproxy.NewConfig(lbs)
|
||||
if err != nil {
|
||||
cc.Error(err, "error reading haproxy config")
|
||||
<-t.C
|
||||
continue
|
||||
}
|
||||
err = ha.UpdateConfig(ctx, lbcfg)
|
||||
if err != nil {
|
||||
cc.Error(err, "error updating haproxy config")
|
||||
<-t.C
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue