NOS-12728: Added create-only extension to YANG - #234
Conversation
|
|
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
133d0fb to
eb3d205
Compare
|
/azp run |
2 similar comments
|
/azp run |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
2 similar comments
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
The PR description explains why ext:create-only is needed, but I'm unclear on the model-consumption path. How does this new extension become available to GCU at runtime? SONiC currently has YANG models in both sonic-mgmt-common and sonic-buildimage/src/sonic-yang-models. My understanding is that the former is primarily used by CVL/libyang for OpenConfig-to-SONiC model mapping, while the latter is the schema source consumed by GCU/libyang. Please check this: |
Hi @kwangsuk, yes you are completely correct. I had anticipated also having companion PRs in sonic-utilities and sonic-buildimage, but I'm currently resolving some CI errors in Nexthop's private fork before I upstream. I will update the PR description and comment accordingly once these are posted. |
|
@kwangsuk This PR has the implementation where this annotation will be consumed: sonic-net/sonic-utilities#4733. Could I request a review on this one too? I put my annotations in the YANG models here: sonic-net/sonic-buildimage#28737 |
- Move hardcoded create-only properties to formal YANG schema annotations. - Resolve Generic Config Updater dependency on custom extension definition. Signed-off-by: Bradley Konane Moon <bradleymoon@nexthop.ai>
eb3d205 to
d02c2a0
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
PR Description: Add create-only Extension to YANG Models
Why I did it
To support dynamic discovery of immutable (create-only) database fields in the Generic Config Updater (GCU), we need a standardized way to annotate fields directly in the SONiC YANG models. Previously,
CreateOnlyFilterinsonic-utilitiesrelied on hardcoded lists of immutable fields (such as port lanes). This hardcoding makes the system difficult to maintain, scale, and extend as new tables or create-only attributes are introduced.By defining an
ext:create-onlyextension insonic-extension.yang, we establish a clean, schema-driven approach. The GCU can compile these schemas usinglibyangand dynamically identify immutable fields during patch operations.