Skip to content

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.

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