mirror of https://github.com/etcd-io/dbtester.git
agent: set 'cetcd', 'zetcd' flags per releases
This commit is contained in:
parent
687bdb3c81
commit
17a972b474
|
|
@ -18,6 +18,8 @@ import (
|
|||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/coreos/dbtester/dbtesterpb"
|
||||
)
|
||||
|
||||
// startCetcd starts cetcd. This assumes that etcd is already started.
|
||||
|
|
@ -32,11 +34,19 @@ func startCetcd(fs *flags, t *transporterServer) error {
|
|||
clientURLs[i] = fmt.Sprintf("http://%s:2379", u)
|
||||
}
|
||||
|
||||
flags := []string{
|
||||
var flags []string
|
||||
switch t.req.DatabaseID {
|
||||
case dbtesterpb.DatabaseID_cetcd__beta:
|
||||
flags = []string{
|
||||
// "-consuladdr", "0.0.0.0:8500",
|
||||
"-consuladdr", fmt.Sprintf("%s:8500", peerIPs[t.req.IPIndex]),
|
||||
"-etcd", clientURLs[t.req.IPIndex], // etcd endpoint
|
||||
}
|
||||
|
||||
default:
|
||||
return fmt.Errorf("database ID %q is not supported", t.req.DatabaseID)
|
||||
}
|
||||
|
||||
flagString := strings.Join(flags, " ")
|
||||
|
||||
cmd := exec.Command(fs.cetcdExec, flags...)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import (
|
|||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/coreos/dbtester/dbtesterpb"
|
||||
)
|
||||
|
||||
// startZetcd starts zetcd. This assumes that etcd is already started.
|
||||
|
|
@ -32,11 +34,19 @@ func startZetcd(fs *flags, t *transporterServer) error {
|
|||
clientURLs[i] = fmt.Sprintf("http://%s:2379", u)
|
||||
}
|
||||
|
||||
flags := []string{
|
||||
var flags []string
|
||||
switch t.req.DatabaseID {
|
||||
case dbtesterpb.DatabaseID_zetcd__beta:
|
||||
flags = []string{
|
||||
// "-zkaddr", "0.0.0.0:2181",
|
||||
"-zkaddr", fmt.Sprintf("%s:2181", peerIPs[t.req.IPIndex]),
|
||||
"-endpoint", clientURLs[t.req.IPIndex],
|
||||
}
|
||||
|
||||
default:
|
||||
return fmt.Errorf("database ID %q is not supported", t.req.DatabaseID)
|
||||
}
|
||||
|
||||
flagString := strings.Join(flags, " ")
|
||||
|
||||
cmd := exec.Command(fs.zetcdExec, flags...)
|
||||
|
|
|
|||
Loading…
Reference in New Issue