No longer add first errors twice
@@ -213,10 +213,11 @@ func validateCerts(state cluster.State) error {
if _, err := cert.Verify(x509.VerifyOptions{Roots: certPool, KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}}); err != nil {
if failedErrs == nil {
failedErrs = fmt.Errorf("Certificate [%s] failed verification: %v", certPKI.Name, err)
- }
+ } else {
failedErrs = errors.Wrap(failedErrs, fmt.Sprintf("Certificate [%s] failed verification: %v", certPKI.Name, err))
}
}
+ }
if failedErrs != nil {
return errors.Wrap(failedErrs, "[etcd] Failed to restore etcd snapshot: invalid certs")
}
