ygot icon indicating copy to clipboard operation
ygot copied to clipboard

Don't accidentally create leaves using SetNode/GetOrCreateNode

Open wenovus opened this issue 4 years ago • 1 comments

2. going forward, we'll keep a note of the first entry that we initialise when doing `SetNode` or `GetOrCreate....`, and if the final call fails or is ignored (because it is a shadowpath), we'll uninitialise the first initialised node to undo our work. This will be for all use cases of this function.

Originally posted by @robshakir in https://github.com/openconfig/ygot/pull/543#discussion_r651359155

wenovus avatar Jun 15 '21 20:06 wenovus

A TODO comment: https://github.com/openconfig/ygot/blob/master/ytypes/node.go#L508-L511

There is also currently a unit test for it that has a TODO.

wenovus avatar Jan 05 '23 00:01 wenovus