forked from sonic-net/sonic-host-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[202211] [hostcfgd] Fix issue: FeatureHandler might override user con…
…figuration (sonic-net#58) (sonic-net#59) - Why I did this? hostcfgd is using a subscribe/listen way to handle configuration data. It handles feature configuration like this: subscribe to CONFIG DB FEATURE table read initial data from CONFIG DB FEATURE table and call FeatureHandler.sync_state_field to process the initial data As FEATURE table "state" field might be a template, FeatureHandler is responsible for rendering it FeatureHandler will "resync" the rendered "state" back to CONFIG DB However, if there is a user configuration occurs between step 2 and step 3, user configuration will be silently ignored and override. Here is an example: subscribe to CONFIG DB FEATURE table read initial FEATURE data, say sflow.state = disabled. FeatureHandler.sync_state_field get an input that "sflow.state = disabled" user issued command "config feature state sflow enabled". Now sflow.state is enabled in FEATURE table. FeatureHandler.sync_state_field continues running and resync "sflow.state = disabled" back to FEATURE table In this case, user configuration in step#3 will be override. The PR is a fix for this issue. - How I verified? Added new unit test
- Loading branch information
1 parent
62dd8b5
commit 7ab0978
Showing
2 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters