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

Post-hook command not executed during initial dump #28

Open
aderouineau opened this issue Jun 18, 2019 · 4 comments
Open

Post-hook command not executed during initial dump #28

aderouineau opened this issue Jun 18, 2019 · 4 comments

Comments

@aderouineau
Copy link

When running traefik-certs-dumper with --watch, --post-hook and file, an initial dump happens when the program gets launched but the hook does not get executed.

I see 2 solutions:

  1. Do not run an initial dump in watch mode (this is how kv behaves)
  2. Always run an initial dump and always execute the post-hook if it is provided

Please note that at the moment, file and kv do not behave the same way (see above). Whichever solution is chosen above should be reflected in both file and kv for consistency.

@ldez
Copy link
Owner

ldez commented Jun 18, 2019

already fixed by #26

@aderouineau
Copy link
Author

I see the following things not fixed by PR #26:

  • The behavior is not consistent with kv: either kv should also perform an initial dump as well (preferred), or file should not perform an initial dump.
  • There is always an initial dump, even when --watch is not specified. The entire content of the destination directory is re-created, even if the files themselves do not change. So technically there is a change, and the post-hook should be executed. Therefore the post-hook should always be executed if it is specified; not just in watch mode.

@ldez
Copy link
Owner

ldez commented Jun 18, 2019

Do you agree that the post-hook command is now executed during initial dump for file?
If yes, the main issue is fixed.

  • there is no initial dump for KV, it can be another issue.

  • "technically there is a change", there is no changes on the certs content or on the certs number. The current post hook (because of its real meaning) is not the "good" hook to manage what you explain. I think that another hook can be added to do that. It also can be another issue.

@aderouineau
Copy link
Author

I agree: the main issue is fixed. I will create an issue for "kv" not having an initial dump.

I do not agree for your second point. There may have been a change in certs during initial dump -- we just don't know, because it is the initial dump. Whether there really is a change or not, the contents of the dump directory are still re-created. I therefore do not see a reason not to execute the post-hook, even when --watch is not used.

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