cert-manager / trust-manager

trust-manager is an operator for distributing trust bundles across a Kubernetes cluster.
https://cert-manager.io/docs/projects/trust-manager/
Apache License 2.0
233 stars 64 forks source link

Avoid multiple decode/encode of certificates #305

Open erikgb opened 4 months ago

erikgb commented 4 months ago
          I have a feeling we are decoding/encoding certs in bundles multiple times already, and this adds another round of decode/encode. What about using a "Cert Pool" as an intermediate format between functions - instead of `[]string` or `[]byte`? We could fix this in a follow-up PR. Just wanted to note it here.

_Originally posted by @erikgb in https://github.com/cert-manager/trust-manager/pull/303#discussion_r1501880524_

arsenalzp commented 3 months ago

Hello, Can I work on this? If we have the final decision, I cat work on this issue to improve code usage and performance. I would appreciate any suggestions how can we improve. As far as I remember CertPool usage was suggested.

erikgb commented 3 months ago

Please do, @arsenalzp! 🎉 Anything that needs to be decided?

arsenalzp commented 3 months ago

Please do, @arsenalzp! 🎉 Anything that needs to be decided?

As usually, during the work process we finding out the best decision :)

arsenalzp commented 3 months ago

/assign

erikgb commented 2 months ago

@arsenalzp Are you working on this issue? If not, I am considering to take a stab. 🤠

arsenalzp commented 2 months ago

@arsenalzp Are you working on this issue? If not, I am considering to take a stab. 🤠

Hello, Sure, I don't forget about this issue, however I pushed all my strengths to pass one of AWS Architect exam. Please, don't re-assign this issue to anyone else, I will manage with it soon :)

arsenalzp commented 2 weeks ago

Sorry for delayed response, I started working on this issue. I found some changes were made for source.go and sync.go.

arsenalzp commented 2 weeks ago

Hello, How do you think, should be maintain CertPool structure between all functions: in source.go, pem.go, cert_pool.go? Or just between pem.go and cert_pool.go and keep as it is in source.go?

erikgb commented 2 weeks ago

Hello,

How do you think, should be maintain CertPool structure between all functions: in source.go, pem.go, cert_pool.go? Or just between pem.go and cert_pool.go and keep as it is in source.go?

I am a bit out of context, but if it makes sense to keep the cert pool from source to target, I will imagine that would make the code more compact and easier to read/understand?