Hide details of delegated agents for PR and LB, to disable docker for LB (#872)

* Move delegated agent creation within NewLBAgent so we can hide the fact we disable docker
* Move delegated agent creation within NewPureRunner for better encapsulation
This commit is contained in:
Dario Domizioli
2018-03-20 13:45:45 +00:00
committed by GitHub
parent 38eebf69cd
commit 27ffb561e8
5 changed files with 23 additions and 20 deletions

View File

@@ -546,15 +546,16 @@ func (pr *pureRunner) Start() error {
return err
}
func UnsecuredPureRunner(cancel context.CancelFunc, addr string, a Agent) (*pureRunner, error) {
return NewPureRunner(cancel, addr, a, "", "", "", nil)
func UnsecuredPureRunner(cancel context.CancelFunc, addr string, da DataAccess) (*pureRunner, error) {
return NewPureRunner(cancel, addr, da, "", "", "", nil)
}
func DefaultPureRunner(cancel context.CancelFunc, addr string, a Agent, cert string, key string, ca string) (*pureRunner, error) {
return NewPureRunner(cancel, addr, a, cert, key, ca, nil)
func DefaultPureRunner(cancel context.CancelFunc, addr string, da DataAccess, cert string, key string, ca string) (*pureRunner, error) {
return NewPureRunner(cancel, addr, da, cert, key, ca, nil)
}
func NewPureRunner(cancel context.CancelFunc, addr string, a Agent, cert string, key string, ca string, gate CapacityGate) (*pureRunner, error) {
func NewPureRunner(cancel context.CancelFunc, addr string, da DataAccess, cert string, key string, ca string, gate CapacityGate) (*pureRunner, error) {
a := createAgent(da, true)
var pr *pureRunner
var err error
if cert != "" && key != "" && ca != "" {