Fix gNMI SET failure for union with leafref and string literals#216
Open
rakshitha-marvell wants to merge 2 commits into
Open
Fix gNMI SET failure for union with leafref and string literals#216rakshitha-marvell wants to merge 2 commits into
rakshitha-marvell wants to merge 2 commits into
Conversation
Fixes : sonic-net/sonic-gnmi#669 Problem: gNMI SET fails for SONiC models such as PFCWD, SFLOW, and QUEUE when union types contain a combination of leafref and string literals. The validation logic incorrectly rejects valid literal values. Root Cause: Union validation in CVL/yparser does not correctly handle mixed union types involving leafref and literal strings. Literal values are not properly matched against union members, leading to validation failure. Fix: - Update union handling logic in yparser to correctly validate literal values alongside leafref types. - Ensure proper resolution and comparison of union members. Signed-off-by: rakshitha-marvell <rsk@marvell.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@ronan-nexthop Can you please review? |
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.
Fixes : sonic-net/sonic-gnmi#669
Problem:
gNMI SET fails for SONiC models such as PFCWD, SFLOW, and QUEUE when union types contain a combination of leafref and string literals. The validation logic incorrectly rejects valid literal values.
Root Cause:
Union validation in CVL/yparser does not correctly handle mixed union types involving leafref and literal strings. Literal values are not properly matched against union members, leading to validation failure. Right now, all string literals are ignored, only leafrefs are matched.
Fix:
This ensures valid literal values [ such as all, CPU and GLOBAL ] are accepted while preserving existing leafref validation for real interface/port references.