more work done
This commit is contained in:
parent
09fe1cd163
commit
6fda229a8e
23 changed files with 384 additions and 177 deletions
|
|
@ -7,12 +7,13 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sync"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
type ServiceManager interface {
|
||||
Reload()
|
||||
Reload(context.Context) error
|
||||
}
|
||||
|
||||
type HAProxyManager struct {
|
||||
|
|
@ -25,7 +26,7 @@ type HAProxyManager struct {
|
|||
}
|
||||
|
||||
func NewHAProxyManager(configFile string) (*HAProxyManager, error) {
|
||||
t, err := template.New("haproxy").Parse(haproxyTemplate)
|
||||
t, err := template.New("haproxy").Parse(haproxyConfigTemplate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -74,5 +75,5 @@ func (ha *HAProxyManager) UpdateConfig(ctx context.Context, lbs Config) error {
|
|||
}
|
||||
file.Close()
|
||||
ha.hash = hash
|
||||
return ha.serviceManager.Reload()
|
||||
return ha.serviceManager.Reload(ctx)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue