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:
@@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user