Skip to content

Commit 04eff64

Browse files
committed
Improve GNMI_CLIENT_CERT table to support multiple roles.
Improve GNMI_CLIENT_CERT table to support multiple roles. #### Why I did it GNMI need support multiple roles. HLD: sonic-net/SONiC#1967 ##### Work item tracking - Microsoft ADO **(number only)**:31561802 #### How I did it Change GNMI_CLIENT_CERT table yang model. #### How to verify it Pass all test case. This PR depends on following PRs: sonic-net/sonic-gnmi#366 sonic-net/sonic-mgmt#17866 #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog Improve GNMI_CLIENT_CERT table to support multiple roles. <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> #### A picture of a cute animal (not mandatory but encouraged)
1 parent c3bd9e0 commit 04eff64

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/sonic-yang-models/tests/files/sample_config_db.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,10 +1390,14 @@
13901390
},
13911391
"GNMI_CLIENT_CERT": {
13921392
"testcert1": {
1393-
"role": "RW"
1393+
"role": [
1394+
"RW"
1395+
]
13941396
},
13951397
"testcert2": {
1396-
"role": "RO"
1398+
"role": [
1399+
"RO"
1400+
]
13971401
}
13981402
},
13991403
"TUNNEL": {

src/sonic-yang-models/tests/yang_model_tests/tests/gnmi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"GNMI_CLIENT_CERT_LIST_TABLE_WITH_MISSING_ROLE": {
2222
"desc": "CLIENT_CERT_LIST_TABLE_WITH_MISSING_ROLE failure.",
23-
"eStrKey": "Mandatory"
23+
"eStrKey": "MinElements"
2424
},
2525
"GNMI_CLIENT_CERT_LIST_TABLE_WITH_VALID_CONFIG": {
2626
"desc": "TABLE WITH VALID CONFIG."

src/sonic-yang-models/tests/yang_model_tests/tests_config/gnmi.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,15 @@
108108
"GNMI_CLIENT_CERT_LIST": [
109109
{
110110
"cert_cname": "testcert1",
111-
"role": "RW"
111+
"role": [
112+
"RW"
113+
]
112114
},
113115
{
114116
"cert_cname": "testcert2",
115-
"role": "RO"
117+
"role": [
118+
"RO"
119+
]
116120
}
117121
]
118122
}

src/sonic-yang-models/yang-models/sonic-gnmi.yang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ module sonic-gnmi {
107107
"client cert common name";
108108
}
109109

110-
leaf role {
110+
leaf-list role {
111111
type string;
112-
mandatory true;
112+
min-elements 1;
113113
description
114114
"role of client cert common name";
115115
}

0 commit comments

Comments
 (0)