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

persist config digest on caddy instance #4

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

Conversation

cbarbian-sap
Copy link

This is related to coredns/coredns#6243 and coredns/coredns#6263, and prerequisite for coredns/coredns#6244.

What does this PR do:

  1. Enhance caddy.Instance with a new field ConfigDigest, and populate this with a digest of the parsed configuration content (which then includes imported sources); this happens in caddy.ValidateAndExecuteDirectives(). In addition, a function caddy.ConfigDigest() is added to allow consumers (such as the coredns reload plugin) to calculate that digest value for a given caddy.Input.
  2. Add a function plugin.RegisterOrUpdateEventHook() which works like the existing plugin.RegisterEventHook(), but does not panic in case of duplicate registration (instead, just replaces the hook).

Note: these two changes are independent from each other, but both are required for the mentioned PR coredns/coredns#6244.

Signed-off-by: Christoph Barbian <christoph.barbian@sap.com>
Signed-off-by: Christoph Barbian <christoph.barbian@sap.com>
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