jetstack / kube-lego

DEPRECATED: Automatically request certificates for Kubernetes Ingress resources from Let's Encrypt
Apache License 2.0
2.16k stars 267 forks source link

Memoize secret obj #241

Closed ElvinEfendi closed 6 years ago

ElvinEfendi commented 7 years ago

(i *Tls) Process() function makes an extra client.KubeClient().Secrets(namespace).Get(name, k8sMeta.GetOptions{}) call when a certificate needed for a given Tls object. The first call happens in i.newCertNeeded and the second call happens in i.RequestCert. There's already an effort for memoization of secret object, but it is buggy(I'm assuming that was not intentional - correct me if I'm wrong), i.e it does not set the initialized secret object to t.secret variable. The PR fixes the issue and adds test coverage.

simonswine commented 6 years ago

Thanks for this contribution!