fix(yurthub): fix filtermanager state divergence and reset logic for … - #2768
fix(yurthub): fix filtermanager state divergence and reset logic for …#2768WorrierKhushal wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2768 +/- ##
==========================================
- Coverage 46.20% 46.16% -0.04%
==========================================
Files 405 405
Lines 27540 27628 +88
==========================================
+ Hits 12724 12755 +31
- Misses 13649 13698 +49
- Partials 1167 1175 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
Hi maintainers @zyjhtangtang sir , I have resolved the filtermanager state divergence issue and cleaned up all the linter checks (including the recent formatting checks). All CI actions and tests are now passing successfully. Could you please take a look and review this PR when you get a chance? Thank you! |



What type of PR is this?
/kind bug
What this PR does / why we need it:
When the
yurt-hub-cfgConfigMap is updated at runtime,pkg/yurthub/configuration.Managerupdates its internal state, but the activeFilterManagerinstance (nameToObjectFilterandresourceSyncers) was never re-initialized or notified of the change.This mismatch caused a silent state divergence between control-plane configuration and active edge proxy handling, forcing administrators to completely restart YurtHub instances to apply configuration updates.
This PR:
AddListenerandnotifyListenersmechanism inconfiguration.Managerso components can register for config-change notifications.Resetmethod onFilterManagerprotected by a mutex lock, which stops existing resource syncers to prevent goroutine/watch leaks, rebuilds filters, and safely swaps state.FilterManager.Resetduring YurtHub startup so runtimeyurt-hub-cfgreloads automatically and dynamically re-syncs active filters and resource syncers without requiring a process restart.fake_filtermanager.goand updates tests (manager_test.go) to match the simplified Reset signature.Fixes #2767
Verified locally with: