consul-client icon indicating copy to clipboard operation
consul-client copied to clipboard

No releaseLock method exposed in the KV Client to preserve the existing value

Open jcass8695 opened this issue 4 years ago • 0 comments

Currently there is no override of the releaseLock method exposed in the KV client that allows the user to preserve the existing value in the KV store.

The existing method does not take a value parameter, causing the underlying PUT API call to overwrite whatever value is currently in the store with an empty string.

The acquireLock method does expose such a method, so a fix would be to mimic that behaviour.

To reproduce the issue

  • Add a value to the KV store, by any method.
  • Call the acquireLock(String, String) library method on the key in question.
  • Observe the value being overwritten to "".

I could probably make a PR for this, if the maintainers are busy :)

jcass8695 avatar Apr 16 '20 17:04 jcass8695