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

User-config Watcher #3898

Merged

Commits on Jan 17, 2018

  1. Rename and group watcher fields

    Now that there are multiple watchers in the Manager struct, it makes
    sense to make the SpecWatcher field more descriptive. Also, there will
    be yet another watcher coming soon to the struct, so group them
    together.
    
    Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
    Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    23f9606 View commit details
    Browse the repository at this point in the history
  2. Use a constant for user.toml

    It's used in several places, so a constant makes sense - it will be
    helpful in avoiding possible typos in strings that wouldn't be caught
    by a compiler.
    
    Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
    Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    4bf55e0 View commit details
    Browse the repository at this point in the history
  3. Persist user config directory to allow reloading configuration therein

    We will need to reload the user config everytime we notice that it has
    changed. To be able to do it, we need to remember which path for the
    user configuration was used when loading it for the first time. Also,
    we start differentiating the deprecated and recommended paths in the
    API, so user config watcher can easily tell if the path was deprecated
    or not. The deprecated paths will not be watched.
    
    Signed-off-by: Krzesimir Nowak <krzesimir@kinvolk.io>
    krnowak authored and Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    a25d3bc View commit details
    Browse the repository at this point in the history
  4. Allow skipping the initial event in file watcher

    Sometimes the initial event is problematic, because the initial
    existence of the file (or lack of it) was already handled. Getting the
    initial event could result in useless work being done again.
    
    Signed-off-by: Krzesimir Nowak <krzesimir@kinvolk.io>
    Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
    krnowak authored and Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    f1946a8 View commit details
    Browse the repository at this point in the history
  5. Expose the watch delay FileWatcher is using.

    The delay will be used by tests to make sure that they wait long
    enough for the watcher to be able to send events.
    
    Signed-off-by: Krzesimir Nowak <krzesimir@kinvolk.io>
    krnowak authored and Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    86fa371 View commit details
    Browse the repository at this point in the history
  6. Add UserConfigWatcher

    The UserConfigWatcher watches each service's user.toml file.
    It reacts on file creation, deletion and change, triggering a service
    reload and configuration.
    
    If a service has hooks defined, those are executed, otherwise the
    default actions are performed instead.
    
    Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
    Signed-off-by: Krzesimir Nowak <krzesimir@kinvolk.io>
    Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    3a5448b View commit details
    Browse the repository at this point in the history
  7. Use UserConfigWatcher in Manager

    In this commit the UserConfigWatcher is hooked into the Manager. The Manager
    can now handle events from the watcher and trigger a reload of services
    it is supervising on configuration change.
    
    Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
    Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    a02e3a0 View commit details
    Browse the repository at this point in the history
  8. Update website documentation to reflect changes in this PR

    There is a new logging key for the user config watcher. And some
    semantics of the reconfigure hook have changed.
    
    Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
    Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    b4a81f9 View commit details
    Browse the repository at this point in the history
  9. Add or update some API docs

    Some functions were undocumented, some of them had wrong docs or
    typos, some of them needed a small update in docs after the
    reload-on-configuration-change work.
    
    Signed-off-by: Lorenzo Manacorda <lorenzo@kinvolk.io>
    Lorenzo Manacorda committed Jan 17, 2018
    Configuration menu
    Copy the full SHA
    fcdec28 View commit details
    Browse the repository at this point in the history