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

[BUG] FileChangeReloadStrategy doesn't deal properly with symlink changes #65

Closed
rocketraman opened this issue Sep 20, 2019 · 1 comment

Comments

@rocketraman
Copy link
Contributor

Describe the bug
In some environments (Kubernetes), a config file can actually be a chain of symlinks. When the ConfigMap backing the chain of symlinks changes, Kubernetes doesn't update the real file itself, but instead just changes the symlinks to point to a different file entirely.

In Kubernetes, this layout may look like this:

configfile -> ..data/configfile
 ..data -> ..2019_09_20_05_25_13.1
..2019_09_20_05_25_13.1/configfile
..2019_09_20_05_25_13.2/configfile

and when the backing ConfigMap changes, K8S creates a new timestamped directory containing the updated config file, points the ..data symlink to it, and then deletes the old timestamped directory.

To Reproduce
Create the directory structure shown above. Modify the ..data symlink to point to the .2 timestamped directory, containing a different version of configfile:

ln -sfn ..2019_09_20_05_25_13.2 ..data

The config should reload, but it does not.

Expected behavior
The watcher needs to follow the chain of symlinks up to the real file, and check if any of these symlinks have been changed in order to trigger a reload.

Additional context
I will submit a pull request for this.

@jdiazcano
Copy link
Owner

I just merged

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

No branches or pull requests

2 participants