Skip to content

Commit

Permalink
use latest core client to support HA & LB
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Aug 17, 2020
1 parent 27761b4 commit bb8fc38
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 55 deletions.
2 changes: 1 addition & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func serve(c *cli.Context) error {
watcher.InitMonitor()
go watcher.LogMonitor.Serve()

agent, err := engine.NewEngine(config)
agent, err := engine.NewEngine(c.Context, config)
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ type Engine struct {
}

//NewEngine make a engine instance
func NewEngine(config *types.Config) (*Engine, error) {
func NewEngine(ctx context.Context, config *types.Config) (*Engine, error) {
engine := &Engine{}
docker, err := utils.MakeDockerClient(config)
if err != nil {
return nil, err
}

store, err := corestore.NewClient(config)
store, err := corestore.NewClient(ctx, config)
if err != nil {
return nil, err
}
Expand Down
22 changes: 15 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@ require (
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/docker/docker v0.0.0-20181113085551-758255791e25
github.com/docker/go-units v0.3.3
github.com/docker/go-units v0.4.0
github.com/go-ole/go-ole v0.0.0-20180213002836-a1ec82a652eb // indirect
github.com/gorilla/mux v1.7.0 // indirect
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/websocket v1.4.0 // indirect
github.com/jinzhu/configor v1.1.1
github.com/projecteru2/core v0.0.0-20200721083909-22e0c91a0cf7
github.com/prometheus/client_golang v1.0.0
github.com/jinzhu/configor v1.2.0
github.com/libgit2/git2go/v30 v30.0.3 // indirect
github.com/projecteru2/core v0.0.0-20200817033302-333f86113b59
github.com/prometheus/client_golang v1.7.1
github.com/shirou/gopsutil v2.20.2+incompatible
github.com/sirupsen/logrus v1.4.2
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.6.1
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/urfave/cli/v2 v2.2.0
go.uber.org/automaxprocs v1.3.0
golang.org/x/net v0.0.0-20200319234117-63522dbf7eec
golang.org/x/mod v0.3.0 // indirect
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/tools v0.0.0-20200612022331-742c5eb664c2 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c // indirect
)
Loading

0 comments on commit bb8fc38

Please sign in to comment.