breser / git2consul

Mirrors the contents of a git repository into Consul KVs.
Other
763 stars 164 forks source link

adding '/' to consul kv del path to avoid greedy pattern matching and… #182

Open moczkows opened 6 years ago

moczkows commented 6 years ago

… remove desired key/subtree

Issue - having files:

After both are added and populated to consul, when I modify test.yaml only then test.yaml is updated in consul, but test_dev.yaml is removed at the same time.

I think it is related to not having '/' at del path. See: https://www.consul.io/docs/commands/kv/delete.html ("Trailing slashes are important" section)

Local modification fixed problem, but I am not aware of other consequences - would be happy to hear. Also there is second dev reference at the top of file I am not sure I should also modify.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.03%) to 94.192% when pulling 51d4f6139023f8eec69350c471eb149e3836e4ff on moczkows:master into 2b239b65cddb094c78050420e16054a487a81ac3 on breser:master.

moczkows commented 6 years ago

commits have wrong user - sorry ryanbreen! I committed from machine when tests were setup and I setup git repo same as travis build was doing (with your user info)

moczkows commented 6 years ago

Appending "/" to path before delete is now executed only when "expand" mode is used, so we know we are handling consul folders. It fixed failing tests.