Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stop watching config on err #148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cptavatar
Copy link

@cptavatar cptavatar commented May 26, 2017

This PR addresses two issues.

The first is that the loop used to trigger a halt on change (-h) will stop watching for changes if an error is encountered. This can be be recreated by using the provided unit test or by...

  • starting up consul agent (perhaps with consul agent -dev)
  • seeding consul kv with a git2consul config
  • starting up git2consul with -h
  • stop consul agent (at this point git2consul will still run, but the watcher loop will report an error and quit)
  • start back up consul agent.
  • update consul kv with a modified git2consul config

Expected behavior is that git2consul will detect the modified config and quit since it continues to run. Actual behavior is that the modified config is ignored.

Second, while I was looking into this I saw that when the watcher is set up it used a hardcoded value for the key location. This would be problematic if an alternate config location (-c) was specified. I updated to use the global value (if available).

Alex Rose added 2 commits May 26, 2017 09:31
Add fix for config watch not using global config_key
Update  halt_on_change test to verify fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant