Closed arybolovlev closed 3 months ago
Looks good, technically. Left some optional error message suggestions, but feel free to ignore them.
One question though, as I didn't trace the calls to these functions back through the code: will this lead to more frequent calls to the API to fetch CM and secrets? In theory, for each new key value that's needed, it would make a new call, right?
We should be good here. The controller runtime client uses a cache to cache API responses. I have validated this with the API server metrics and it works well. :)
Description
This PR replaces the per-controller reconciler methods
getSecret
andgetConfigMap
, which returned corresponding Kubernetes objects, with a more generic functionsconfigMapKeyRef
andsecretKeyRef
. These functions return only a requested key or an error if the key or object does not exist.Tests
Usage Example
N/A.
References
N/A.
Community Note