clear acme client cache whenever an acme issuer is changed
This is a very in-elegant solution to the problem, but it avoids having to look at other extant issuers and having background processes. Signed-off-by: Daniel Morsing <dmo@jetstack.io>
This commit is contained in:
parent
19f66c4053
commit
e2123ccbb3
@ -193,6 +193,12 @@ func lookupClient(spec *cmapi.ACMEIssuer, status *cmapi.ACMEIssuerStatus, pk *rs
|
||||
return acmeCl
|
||||
}
|
||||
|
||||
func ClearClientCache() {
|
||||
clientRepoMu.Lock()
|
||||
defer clientRepoMu.Unlock()
|
||||
clientRepo = nil
|
||||
}
|
||||
|
||||
// buildHTTPClient returns an HTTP client to be used by the ACME client.
|
||||
// For the time being, we construct a new HTTP client on each invocation.
|
||||
// This is because we need to set the 'skipTLSVerify' flag on the HTTP client
|
||||
|
||||
@ -96,6 +96,8 @@ func (a *Acme) Setup(ctx context.Context) error {
|
||||
|
||||
}
|
||||
|
||||
acme.ClearClientCache()
|
||||
|
||||
cl, err := acme.ClientWithKey(a.issuer, pk)
|
||||
if err != nil {
|
||||
s := messageAccountVerificationFailed + err.Error()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user