Serf keyring operations write to disk in Consul dev mode #2630
Labels
theme/internal-cleanup
Used to identify tech debt, testing improvements, code refactoring, and non-impactful optimization
type/bug
Feature does not function as expected
Server version:
Consul v0.7.2
Client version: N/A
Operating system and Environment details
Windows 8.1, development done locally
Description of the Issue (and unexpected/desired result)
I ran into the following issue while implementing the
/v1/operator/keyring
API for my Consul.NET API - it seems that using the serf keyring calls in dev mode writes to the disk, which breaks testing in new and fun ways.Expected result: Restarting the server in dev mode deletes all encryption keys except that which is specified in the config file.
Actual result: Serf writes installed encryption keys to a local directory which is preserved in dev mode.
Reproduction steps
I'm running Consul as follows:
consul.exe agent -dev -config-file test_config.json
and test_config.json contains the following:If I start Consul with the command above and in another prompt run
consul.exe keyring -list
, I get, as expected:If I add another one, e.g.
consul.exe keyring -install 7a9OTTuJHbTdatQ/pRlw2g==
I get, as expected:However, this creates a
./serf
directory withlocal.keyring
andremote.keyring
in it.If I restart the server, which, as a reminder is in Dev mode so it doesn't write to disk or keep state, and then do
consul.exe keyring -list
I get:The text was updated successfully, but these errors were encountered: