mirror of
https://github.com/external-secrets/external-secrets.git
synced 2024-12-14 11:57:59 +00:00
Add more context to error handling for parsing certs in order for log format to display properly (#2428)
* Add more context to error handling for parsing certs in order for log format to display properly Signed-off-by: Dusan Nikolic <dusannikolic11@gmail.com> * Create error instead of string as arg Signed-off-by: Dusan Nikolic <dusannikolic11@gmail.com> * fix: unit test Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> --------- Signed-off-by: Dusan Nikolic <dusannikolic11@gmail.com> Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> Co-authored-by: Dusan Nikolic <dusannikolic@MacBook-Pro-66.local> Co-authored-by: Moritz Johner <beller.moritz@googlemail.com>
This commit is contained in:
parent
759c5e40f9
commit
298f580d1e
2 changed files with 3 additions and 3 deletions
|
@ -993,7 +993,7 @@ func (v *client) newConfig() (*vault.Config, error) {
|
|||
if len(v.store.CABundle) > 0 {
|
||||
ok := caCertPool.AppendCertsFromPEM(v.store.CABundle)
|
||||
if !ok {
|
||||
return nil, errors.New(errVaultCert)
|
||||
return nil, fmt.Errorf(errVaultCert, errors.New("failed to parse certificates from CertPool"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1020,7 +1020,7 @@ func (v *client) newConfig() (*vault.Config, error) {
|
|||
|
||||
ok := caCertPool.AppendCertsFromPEM(cert)
|
||||
if !ok {
|
||||
return nil, errors.New(errVaultCert)
|
||||
return nil, fmt.Errorf(errVaultCert, errors.New("failed to parse certificates from CertPool"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ MIIFkTCCA3mgAwIBAgIUBEUg3m/WqAsWHG4Q/II3IePFfuowDQYJKoZIhvcNAQELBQAwWDELMAkGA1UE
|
|||
}),
|
||||
},
|
||||
want: want{
|
||||
err: errors.New(errVaultCert),
|
||||
err: fmt.Errorf(errVaultCert, errors.New("failed to parse certificates from CertPool")),
|
||||
},
|
||||
},
|
||||
"VaultAuthFormatError": {
|
||||
|
|
Loading…
Reference in a new issue