mirror of https://github.com/status-im/consul.git
consul: Expose the KVSDeleteCAS operation in FSM
This commit is contained in:
parent
32e9e8ead5
commit
65bebca0f5
|
@ -149,6 +149,13 @@ func (c *consulFSM) applyKVSOperation(buf []byte, index uint64) interface{} {
|
||||||
return c.state.KVSSet(index, &req.DirEnt)
|
return c.state.KVSSet(index, &req.DirEnt)
|
||||||
case structs.KVSDelete:
|
case structs.KVSDelete:
|
||||||
return c.state.KVSDelete(index, req.DirEnt.Key)
|
return c.state.KVSDelete(index, req.DirEnt.Key)
|
||||||
|
case structs.KVSDeleteCAS:
|
||||||
|
act, err := c.state.KVSDeleteCheckAndSet(index, req.DirEnt.Key, req.DirEnt.ModifyIndex)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
return act
|
||||||
|
}
|
||||||
case structs.KVSDeleteTree:
|
case structs.KVSDeleteTree:
|
||||||
return c.state.KVSDeleteTree(index, req.DirEnt.Key)
|
return c.state.KVSDeleteTree(index, req.DirEnt.Key)
|
||||||
case structs.KVSCAS:
|
case structs.KVSCAS:
|
||||||
|
|
Loading…
Reference in New Issue