Add scope to field validator.[redo PR: 3675] (#3805)#288
Merged
Conversation
Author
|
Original PR: sonic-net/sonic-utilities#3805 |
Author
|
@anamehra please review, thanks |
anamehra
approved these changes
Mar 2, 2026
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 is for fix issue:sonic-net/sonic-buildimage#20379. It was done by sonic-net/sonic-utilities#3675. and it was reverted by sonic-net/sonic-utilities#3689.
This is redo by removing unnecessary change that caused PR test failure.
How I did it
For field_operation_validators, add scope if need read state_db.
How to verify it
admin@str2-7250-lc1-2:~$ sonic-db-cli STATE_DB -n asic0 hget "PORT_TABLE|Ethernet0" supported_fecs
none,rs
admin@str2-7250-lc1-2:~$ cat fec.json
[
{
"op": "add",
"path": "/asic0/PORT/Ethernet0/fec",
"value": "fc"
}
]
admin@str2-7250-lc1-2:~$ sudo config apply-patch fec.json
Patch Applier: asic0: Patch application starting.
Patch Applier: asic0: Patch: [{"op": "add", "path": "/PORT/Ethernet0/fec", "value": "fc"}]
Patch Applier: asic0 getting current config db.
Patch Applier: asic0: simulating the target full config after applying the patch.
Patch Applier: asic0: validating all JsonPatch operations are permitted on the specified fields
Failed to apply patch due to: Failed to apply patch on the following scopes:
Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH
Try "config apply-patch -h" for help.
Error: Failed to apply patch on the following scopes:
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)