Use DirectClient in BB/BE reconciler #2568
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How to categorize this PR?
/area quality
/kind bug
/priority normal
What this PR does / why we need it:
If the
CachedRuntimeClients
feature gate is enabled, the backup entry/bucket reconciler in the gardenlet might not execute any reconciliation the first time the backup bucket/entry is deployed.That's because we are using an Informer created by the SharedInformerFactory here for receiving watch events, but we are actually using a cached runtime client for retrieving the object in the reconciler which uses a separate watch. This in turn means, that the cached runtime client might not have received the add event for a backup bucket/entry, while the Informer already has received an event and enqueued the object for reconciliation. The cached runtime client the gets a
NotFound
error and the reconciler exits early.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
In general, we should always use the same informers for registering event handlers which we also use in our controllers to retrieve the object in the beginning of the reconciliation. For example an Informer from the
SharedInformerFactory
and the respectiveLister
or an Informer from the controller-runtime cache and the cached runtime client.I will do this refactoring in a separate PR, as it requires to not invalidate the Garden ClientSet in any case (also for version changes) which I will have to tackle first.
/cc @timuthy
Release note: