Skip to content

Commit

Permalink
certificates to certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
nak3 committed Apr 11, 2023
1 parent f7a2617 commit 3f73fef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/activator/certificate/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type CertCache struct {
secretInformer v1.SecretInformer
logger *zap.SugaredLogger

certificates *tls.Certificate
TLSConf tls.Config
certificate *tls.Certificate
TLSConf tls.Config

certificatesMux sync.RWMutex
}
Expand All @@ -53,7 +53,7 @@ func NewCertCache(ctx context.Context) *CertCache {

cr := &CertCache{
secretInformer: secretInformer,
certificates: nil,
certificate: nil,
logger: logging.FromContext(ctx),
}

Expand All @@ -80,7 +80,7 @@ func (cr *CertCache) handleCertificateAdd(added interface{}) {
cr.logger.Warnw("failed to parse secret", zap.Error(err))
return
}
cr.certificates = &cert
cr.certificate = &cert
cr.updateTLSConf()
}
}
Expand Down Expand Up @@ -112,5 +112,5 @@ func (cr *CertCache) handleCertificateUpdate(_, new interface{}) {

// GetCertificate returns the cached certificates.
func (cr *CertCache) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error) {
return cr.certificates, nil
return cr.certificate, nil
}

0 comments on commit 3f73fef

Please sign in to comment.