1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-26 07:25:09 +00:00

Merge pull request #1978 from rmweir/redundant-errors

No longer add first errors twice
This commit is contained in:
rmweir
2020-03-18 17:15:34 -07:00
committed by GitHub

View File

@@ -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")
}