-
Notifications
You must be signed in to change notification settings - Fork 672
Expand mount-point/state/type to union of string and enum #1226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
/gcbrun |
Major YANG version changes in commit 4d31308: |
/gcbrun |
type string; | ||
type union { | ||
type string; | ||
type enumeration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few overall comments:
- Depending how this is looked at, it is a backwards incompatible change as you are ultimately changing the underlying YANG type which can have other effects outside of the encoded value representation
- I would propose if doing this to take the enum declaration out into a reusable typedef or better yet a set of expansible identities (and use an identityref rather)
- Reference to
/proc/filesystems
is useful here and there is also an implicit assumption of underlying OS in doing this (this already exists in other spots too) - IMO drop the union - just keep an identityref then and implementations can augment in expanded identities to the base if necessary. If you order the union as such then the rule of thumb is that the value matches the string as first match everytime as both are encoded identically
But if this is looked at as a mapping of the first column of something like df
output (Filesystem) then you have a mish-mash of what can be represented here (This is likely what each implemtation is doing today) meaning alot of different string values (or expanded identities which then don't make as much sense imo)
If this is to be the type
from something like the output of mounts
then corresponds directly w/ the list you might see from /proc/filesystems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we also need the enumeration to be listed above the string in the union definition (I appreciate that you are suggesting that the union isn't needed at all), otherwise everything would always match against the string, regardless of the enum values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evan made this change for us (moved the indentityref before the string)
Thanks for the comments. We reviewed in the Dec 3 operators meeting and there is some rough consensus that making this change to this very new leaf as an indentify-ref like @earies suggests is cleaner and still supports the operational use case. We have good precedence of adding more identity refs as needed in areas like transceiver types. @mrevang could you revise this remove the string entirely and become an identity-ref? |
The new yang would look like:
Then in a new file, such as release/models/system/openconfig-fs-types.yang, add identities for all the desired filesystem types. These identities will be encoded the same as strings (should anyone have implemented it)
and so on |
/gcbrun |
Thanks all for the comments and suggestions. I've removed the union, and replaced the string with an identifyref. |
/gcbrun |
/gcbrun |
/gcbrun |
This will be reviewed at the next OC Operators meeting on July 15, 2025 |
/gcbrun |
Discussed at the OC Operators Meeting on July 15th. Seems generally fine. One suggestion is to change the description |
Thanks for the suggestion, updated accordingly. |
/gcbrun |
Change Scope
Platform Implementations