[BUG] plugin/ready: fix Reset list of readiness plugins (#8035)

Signed-off-by: 杨军10092085 <yang.jun22@zte.com.cn>
This commit is contained in:
JUN YANG
2026-04-11 18:15:28 +08:00
committed by GitHub
parent 0ed3aae547
commit 57a95e2677
3 changed files with 75 additions and 12 deletions

View File

@@ -11,6 +11,7 @@ import (
func init() { plugin.Register("ready", setup) }
func setup(c *caddy.Controller) error {
plugins.Reset()
addr, monType, err := parse(c)
if err != nil {
return plugin.Error("ready", err)
@@ -32,7 +33,6 @@ func setup(c *caddy.Controller) error {
c.OnRestartFailed(func() error { return uniqAddr.ForEach() })
c.OnStartup(func() error {
plugins.Reset()
for _, p := range dnsserver.GetConfig(c).Handlers() {
if r, ok := p.(Readiness); ok {
plugins.Append(r, p.Name())