Skip to content
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

Expand mount-point/state/type to union of string and enum #1226

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mrevang
Copy link

@mrevang mrevang commented Nov 15, 2024

Change Scope

  • This change is being made to add more structure to the content of mount-point/state/type. This will enable more predictable content for programming against.
  • This change is backwards compatible.

Platform Implementations

  • Before mount-point/state/type was added to the standard, it was a Google specific augment.

@mrevang mrevang requested a review from a team as a code owner November 15, 2024 21:03
@dplore
Copy link
Member

dplore commented Nov 15, 2024

/gcbrun

@OpenConfigBot
Copy link

OpenConfigBot commented Nov 15, 2024

No major YANG version changes in commit 3d01ba9

@dplore
Copy link
Member

dplore commented Nov 15, 2024

/gcbrun

type string;
type union {
type string;
type enumeration {
Copy link
Contributor

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

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?

@dplore
Copy link
Member

dplore commented Dec 3, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

5 participants