fix: prevCertificate save not correct in loop (#17744)

fix certs save not correct

Co-authored-by: guozhi.li <guozhi.li@daocloud.io>
This commit is contained in:
jiuker 2023-07-29 03:57:49 +08:00 committed by GitHub
parent 7057d00a28
commit f9d029c8fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,8 +126,8 @@ func NewWithConfig(config Config) (KMS, error) {
if config.Certificate == nil || config.ReloadCertEvents == nil {
return
}
for {
var prevCertificate tls.Certificate
for {
certificate, ok := <-config.ReloadCertEvents
if !ok {
return