[202012][minigraph] Consume golden_config_db.json while loading minigraph#2227
Merged
wen587 merged 2 commits intosonic-net:202012from Jun 23, 2022
Merged
[202012][minigraph] Consume golden_config_db.json while loading minigraph#2227wen587 merged 2 commits intosonic-net:202012from
wen587 merged 2 commits intosonic-net:202012from
Conversation
qiluo-msft
approved these changes
Jun 22, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What I did
This PR is to cherry-pick changes in PR #2140 to
202012branch after resolving conflicts.This PR is for supporting consume
golden_config_db.jsonwhile loading minigraph. User can put thegolden_config_db.jsonwith minigraph file to override configDB after reload minigraph.The
golden_config_db.jsonlooks just like a config_db.json and it will be placed on/etc/sonic/golden_config_db.json.Step1: Load minigraph to configDB
Step2: If golden_config_db.json exists and contains some Table configuration, that Table in configDB will be overriden by the config in golden_config_db.json. Other config that not included in golden_config_db.json will keep the same as minigraph.
For example, assume below ACL_TABLE is loaded from minigraph:
config from minigraph:
The golden_config_db.json also contains ACL_TABLE as below.
config from golden_config_db.json
During load_minigraph, the final config will be the same with golden_config_db.json because ACL_TABLE will be overriden by golden_config_db.json.
configDB ACL_TABLE final state:
How I did it
Add code
config override-config-tablecommand to let it consumegolden_config_db.jsonHow to verify it
Add UT tests and run.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)