소스 검색

grpcproxy: handle 'IgnoreValue' field in PutRequest

Gyu-Ho Lee 9 년 전
부모
커밋
0f8060bede
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      proxy/grpcproxy/kv.go

+ 3 - 1
proxy/grpcproxy/kv.go

@@ -187,7 +187,9 @@ func RangeRequestToOp(r *pb.RangeRequest) clientv3.Op {
 func PutRequestToOp(r *pb.PutRequest) clientv3.Op {
 	opts := []clientv3.OpOption{}
 	opts = append(opts, clientv3.WithLease(clientv3.LeaseID(r.Lease)))
-
+	if r.IgnoreValue {
+		opts = append(opts, clientv3.WithIgnoreValue())
+	}
 	return clientv3.OpPut(string(r.Key), string(r.Value), opts...)
 }