Comments (9)
As with most open source projects, the feature set of ygot tends to be driven by contributions where there is interest in a feature -- and by having those with interest contribute code.
The core maintainers (@wenovus these days) try to ensure that the library is complete for users, but especially with a language as complex as YANG where there are many ways to express things, it's not really possible for us to commit to cover every feature. Equally, we have found that the way that developers expect particular YANG features to be represented varies, and having a real user helps with that.
So, the answer is "it might happen, but it will certainly happen if you contribute code". :-)
from ygot.
w.r.t backwards compatibility -- this should be done by providing some DiffOpt
to ygot.Diff
to say that you care about presence containers IMHO.
from ygot.
This looks like something that needs to be added to ygot.Diff
-- since OpenConfig does not use presence
containers then not all functionality that pertains to them may be supported today.
I'm happy to help with a contribution to add this to the library -- it needs some consideration as to where Diff
finds out that a particular container is a presence
container.
edit: It looks like this should be relatively simple, as the Diff
code traverses the struct then we need to do a IsYANGPresence
check and then if it returns true, then produce output for the container.
from ygot.
I looked into this briefly before I created the issue, but it is a pretty big code base to grasp.
Would you just add an if-else here? https://github.com/openconfig/ygot/blob/master/ygot/diff.go#L310
I'm out for the holidays, but I'd love to tive this a shot next weekend if no one beats me to it. We definitely need this for our Crossplane provider.
Thanks for the great library and the quick response 😊
from ygot.
I had another quick look at this today. Would love some pointers/tips, as I were not successful.
Adding this as a non-optional, paired with ygot.BuildEmptyTree would also probably be breaking, as it would set all these presence containers?
from ygot.
The logic may be added here:
https://github.com/openconfig/ygot/blob/4dcc65ef1230778675d989ce9a4d194512974f17/ygot/diff.go#L316C41-L316C41
I think you want to do a if on util.IsValueStructPtr(ni.FieldValue)
, deal with the orderedMap
case (it's not relevant), and in a separate case check for IsPresence
.
I think the tricky part comes in how you would indicate presence containers in the return value of ygot.Diff. In the out
variable you might want to store some sentinel value to indicate to the comparison code that a particular path is a presence container. In the gpb.Notification output, one option is to use a nil update value to indicate a presence container.
from ygot.
Thanks @wenovus, I'll give it a shot this or next weekend.
I would of course appreciate if anyone else got time to look at an implementation. 😊
from ygot.
Any chance OpenConfig will add support for this, or is this relying on outside contributors (me?)?
from ygot.
I gave GitHub Copilot Workspace a go at this issue, and safe to say it didn't really work. It focused more on removing licensing headers, hehe. (Commit)
I still need this, and will revisit. Do you guys have a slack/IRC/Discord for potential questions? Last time I have this a shot I did not succeed.
from ygot.
Related Issues (20)
- ytypes.GetNode consumes more CPU & memory than the deprecated util.GetNode
- how to resolve the dependency for gribi HOT 2
- Diff api does generate deletes for leaf list values HOT 6
- Can enum preserve their defined values while converting yang to gostruct using openconfig/ygot\@v0.25.4/generator/generator.go ? HOT 3
- Mandatory module name in the generated struct names HOT 3
- Preserve YANG elements order when generating structs HOT 1
- Doesn't choice and case statement in YANG result in oneof fields in proto? HOT 2
- ygot Validate error, when yang leaf type is union
- When will ygot have support for bits datatype for yang to go conversion HOT 2
- Device Returns Array for Each Interface HOT 3
- Allow ytypes.SetNode on intermediate nodes in compressed mode
- Identity Support in Ygot HOT 1
- Union field has nil value after xml.Unmarshal HOT 6
- [Question] From ygot gostruct or emittedJSON to gNMI Set Update HOT 6
- ytypes.Unmarshal() treating 50 as a float64 even though I am converting 50 to string before unmarshalling HOT 7
- How to set LeafrefOptions IgnoreMissingData for UnmarshalSetRequest HOT 2
- Can't generate OC-YANG network-instance HOT 2
- ResolveLeafrefTarget Not returning correct vlaue in case of List inside choice where list's key is a leafref HOT 2
- "default value not supported for wrapper union values" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ygot.