You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: replace contentmanager with shared TrackingCache
Replace the per-ClusterExtension contentmanager cache with a single
shared TrackingCache from boxcutter/managedcache. The contentmanager
created per-CE dynamic clients and informer factories for drift
detection; now that all operations use the same controller identity,
a single global cache is simpler and more efficient.
- Create TrackingCache at shared scope before controller setup
- Wire TrackingCache.Source to CE controller via WithWatchesRawSource
- Replace Manager+Watcher fields in Helm applier with trackingCache
interface (Watch + Free)
- Suppress Create events on the source predicate to match old behavior
- Update finalizer to call TrackingCache.Free instead of cm.Delete
- Remove ClientRestConfigMapper from Helm action config getter
- Update helm_test.go mocks for new interface
- Delete contentmanager/ package (~1,240 lines)
OPRUN-4633
Co-Authored-By: Claude <noreply@anthropic.com>
logger.V(1).Info("setting up drift detection watches on managed objects")
196
196
197
-
// Defensive nil checks to prevent panics if Manager or Watcher not properly initialized
198
-
ifh.Manager==nil {
199
-
logger.Error(fmt.Errorf("manager is nil"), "Manager not initialized, cannot set up drift detection watches (resources are applied but drift detection disabled)")
197
+
ifh.TrackingCache==nil {
198
+
logger.Error(fmt.Errorf("tracking cache is nil"), "TrackingCache not initialized, cannot set up drift detection watches (resources are applied but drift detection disabled)")
200
199
returntrue, "", nil
201
200
}
202
-
cache, err:=h.Manager.Get(ctx, ext)
203
-
iferr!=nil {
204
-
logger.Error(err, "failed to get managed content cache, cannot set up drift detection watches (resources are applied but drift detection disabled)")
205
-
returntrue, "", nil
206
-
}
207
-
208
-
ifh.Watcher==nil {
209
-
logger.Error(fmt.Errorf("watcher is nil"), "Watcher not initialized, cannot set up drift detection watches (resources are applied but drift detection disabled)")
0 commit comments