mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests: Use GetOptions to configure serializble get
This commit is contained in:
parent
744dd077cd
commit
def122871c
@ -64,5 +64,5 @@ func (c e2eClient) Get(key string, opts ...testutils.GetOption) (*clientv3.GetRe
|
||||
for _, opt := range opts {
|
||||
opt(&o)
|
||||
}
|
||||
return c.EtcdctlV3.Get(key, o.Serializable)
|
||||
return c.EtcdctlV3.Get(key, o)
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
"strings"
|
||||
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
"go.etcd.io/etcd/tests/v3/framework/testutils"
|
||||
)
|
||||
|
||||
type EtcdctlV3 struct {
|
||||
@ -38,9 +39,9 @@ func (ctl *EtcdctlV3) DowngradeEnable(version string) error {
|
||||
return SpawnWithExpect(ctl.cmdArgs("downgrade", "enable", version), "Downgrade enable success")
|
||||
}
|
||||
|
||||
func (ctl *EtcdctlV3) Get(key string, serializable bool) (*clientv3.GetResponse, error) {
|
||||
func (ctl *EtcdctlV3) Get(key string, o testutils.GetOptions) (*clientv3.GetResponse, error) {
|
||||
args := ctl.cmdArgs()
|
||||
if serializable {
|
||||
if o.Serializable {
|
||||
args = append(args, "--consistency", "s")
|
||||
}
|
||||
cmd, err := SpawnCmd(append(args, "get", key, "-w", "json"), nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user