From ea73ab534ce38e74ea3bb22dfb2bb03b57aa1ea8 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Fri, 18 Sep 2020 12:02:52 +0100 Subject: [PATCH] Document newIndependentCacheAndDelegatingClient Signed-off-by: Richard Wall --- pkg/controller/cainjector/setup.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/controller/cainjector/setup.go b/pkg/controller/cainjector/setup.go index 86ab3c9db..13efd8fc5 100644 --- a/pkg/controller/cainjector/setup.go +++ b/pkg/controller/cainjector/setup.go @@ -218,6 +218,12 @@ func RegisterSecretBased(ctx context.Context, mgr ctrl.Manager) error { ) } +// newIndependentCacheAndDelegatingClient creates a cache and a delegating +// client which are independent of the cache of the manager. +// This allows us to start the manager and secrets based injectors before the +// cert-manager Certificates CRDs have been installed and before the CA bundles +// have been injected into the cert-manager CRDs, by the secrets based injector, +// which is running in a separate goroutine. func newIndependentCacheAndDelegatingClient(mgr ctrl.Manager) (cache.Cache, client.Client, error) { cacheOptions := cache.Options{ Scheme: mgr.GetScheme(),