From 65bebca0f5225fcae67057c94346d73a3d49bea6 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Thu, 8 Jan 2015 17:08:44 -0800 Subject: [PATCH] consul: Expose the KVSDeleteCAS operation in FSM --- consul/fsm.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/consul/fsm.go b/consul/fsm.go index 7980b98856..e4fcb2026f 100644 --- a/consul/fsm.go +++ b/consul/fsm.go @@ -149,6 +149,13 @@ func (c *consulFSM) applyKVSOperation(buf []byte, index uint64) interface{} { return c.state.KVSSet(index, &req.DirEnt) case structs.KVSDelete: 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: return c.state.KVSDeleteTree(index, req.DirEnt.Key) case structs.KVSCAS: