venafi: ResetCertificate wasn't working
Signed-off-by: Maël Valais <mael@vls.dev>
This commit is contained in:
parent
d8035e668a
commit
d1d92b6398
@ -66,9 +66,12 @@ func (v *Venafi) RequestCertificate(csrPEM []byte, duration time.Duration, custo
|
||||
//
|
||||
// Note that resetting won't affect the existing certificate if one was
|
||||
// already issued.
|
||||
tppConnector, isTPP := v.vcertClient.(*tpp.Connector)
|
||||
if isTPP {
|
||||
err := tppConnector.ResetCertificate(vreq, false)
|
||||
if v.tppClient != nil {
|
||||
// We can't use the instrumented v.vcertClient because its concrete
|
||||
// value is `instrumentedConnector`, which doesn't give access to the
|
||||
// *tpp.Connector it wraps. Also, `instrumentedConnector` doesn't
|
||||
// support `ResetCertificate`.
|
||||
err := v.tppClient.ResetCertificate(vreq, false)
|
||||
notFoundErr := &tpp.ErrCertNotFound{}
|
||||
if err != nil && !errors.As(err, ¬FoundErr) {
|
||||
return "", err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user