(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.
(i *Tls) Process()
function makes an extraclient.KubeClient().Secrets(namespace).Get(name, k8sMeta.GetOptions{})
call when a certificate needed for a givenTls
object. The first call happens ini.newCertNeeded
and the second call happens ini.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 tot.secret
variable. The PR fixes the issue and adds test coverage.