mirror of
https://github.com/coredns/coredns.git
synced 2026-05-26 03:40:23 -04:00
lint(errorlint): handle wrapped errors
Enable errorlint and preserve wrapped error chains so runtime checks and tests classify failures correctly. This also makes Route53 surface insert failures instead of silently dropping them. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package object
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -39,7 +40,7 @@ func DefaultProcessor(convert ToFunc, recordLatency *EndpointLatencyRecorder) Pr
|
||||
case cache.Sync, cache.Added, cache.Updated:
|
||||
obj, err := convert(d.Object.(meta.Object))
|
||||
if err != nil {
|
||||
if err == errPodTerminating {
|
||||
if errors.Is(err, errPodTerminating) {
|
||||
continue
|
||||
}
|
||||
return err
|
||||
@@ -68,7 +69,7 @@ func DefaultProcessor(convert ToFunc, recordLatency *EndpointLatencyRecorder) Pr
|
||||
return fmt.Errorf("unexpected object %v", d.Object)
|
||||
}
|
||||
obj, err = convert(metaObj)
|
||||
if err != nil && err != errPodTerminating {
|
||||
if err != nil && !errors.Is(err, errPodTerminating) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user