mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl/ctlv3: allow empty key
Fix https://github.com/coreos/etcd/issues/5323.
This commit is contained in:
parent
8c953499fa
commit
3ec627d1a8
@ -129,10 +129,18 @@ func getGetOp(cmd *cobra.Command, args []string) (string, []clientv3.OpOption) {
|
||||
opts = append(opts, clientv3.WithSort(sortByTarget, sortByOrder))
|
||||
|
||||
if getPrefix {
|
||||
opts = append(opts, clientv3.WithPrefix())
|
||||
if len(key) == 0 {
|
||||
key = "\x00"
|
||||
opts = append(opts, clientv3.WithFromKey())
|
||||
} else {
|
||||
opts = append(opts, clientv3.WithPrefix())
|
||||
}
|
||||
}
|
||||
|
||||
if getFromKey {
|
||||
if len(key) == 0 {
|
||||
key = "\x00"
|
||||
}
|
||||
opts = append(opts, clientv3.WithFromKey())
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user