mirror of
https://github.com/coredns/coredns.git
synced 2026-10-27 04:35:43 -04:00
plugin/reload: hash the configuration executed by each instance (#8642)
Signed-off-by: houyuwushang <180804215+houyuwushang@users.noreply.github.com>
This commit is contained in:
@@ -22,6 +22,7 @@ const (
|
||||
)
|
||||
|
||||
type reload struct {
|
||||
configHash [sha512.Size]byte
|
||||
dur time.Duration
|
||||
u int
|
||||
mtx sync.RWMutex
|
||||
@@ -90,12 +91,7 @@ func hook(event caddy.EventName, info any) error {
|
||||
if r == nil || r.usage() == unused {
|
||||
return nil
|
||||
}
|
||||
parsedCorefile, err := parse(instance.Caddyfile())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sha512sum := sha512.Sum512(parsedCorefile)
|
||||
sha512sum := r.configHash
|
||||
log.Infof("Running configuration SHA512 = %x\n", sha512sum)
|
||||
quit := r.quit
|
||||
interval := r.interval()
|
||||
|
||||
Reference in New Issue
Block a user