Enabling the restapi_sidecar container to update sonic-restapi.yang - #25484
Closed
mramezani95 wants to merge 2 commits into
Closed
mramezani95 wants to merge 2 commits into
mramezani95 wants to merge 2 commits into
Conversation
Signed-off-by: Mahdi Ramezani <mramezani@microsoft.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the docker-restapi-sidecar sync logic so the sidecar container can manage the on-host sonic-restapi.yang version in /usr/local/yang-models/, selecting the appropriate model depending on whether IS_V1_ENABLED is set.
Changes:
- Add a new
SyncItemto copysonic-restapi.yangonto the host, choosing v1 vs non-v1 source based onIS_V1_ENABLED. - Introduce v1 and non-v1
sonic-restapi.yangpayloads insystemd_scripts/for the sidecar image to publish. - Update and extend
test_systemd_stub.pyto validate v1 vs non-v1 sync behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| dockers/docker-restapi-sidecar/systemd_stub.py | Adds syncing of sonic-restapi.yang to /usr/local/yang-models/ with v1/non-v1 source selection. |
| dockers/docker-restapi-sidecar/systemd_scripts/sonic-restapi.yang | Adds the “new” YANG model payload (wildcard CN support). |
| dockers/docker-restapi-sidecar/systemd_scripts/v1/sonic-restapi.yang | Adds the “old” YANG model payload intended for v1-enabled behavior. |
| dockers/docker-restapi-sidecar/cli-plugin-tests/test_systemd_stub.py | Adds fixtures and tests to validate v1 vs non-v1 sync of both restapi.sh and sonic-restapi.yang. |
Contributor
Contributor
Author
maipbui
approved these changes
Feb 13, 2026
Contributor
Author
|
Closing this pull request since we decided to implement a different solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
#25450 updated
sonic-restapi.yang. This PR enablesrestapi_sidecarto correctly update this file on SONiC devices.Work item tracking
How I did it
SyncItemforsonic-restapi.yang. IfIS_V1_ENABLEDis true,sonic-restapi.yangis updated to the old version (prior to Allowing wildcard client cert CNs in restapi's YANG model #25450). IfIS_V1_ENABLEDis false,sonic-restapi.yangis updated to the new version.test_systemd_stub.py.How to verify it
Run the tests in
test_systemd_stub.py:Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Enabling the
restapi_sidecarcontainer to updatesonic-restapi.yang.Link to config_db schema for YANG module changes
N/A