-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[yang-models] Validating 'services' exist if ACL type is 'CTRLPLANE' #9295
Conversation
there is a build error, i think i will fix it and a unit-test |
Can you please add UT to cover this case? |
Issue #9294 is fixed from my mannually test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comment
@@ -259,6 +259,8 @@ module sonic-acl { | |||
type string; | |||
} | |||
|
|||
must "(type != 'CTRLPLANE') or (boolean(services))"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some comment to explain the constrain? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bingwang-ms Do we require service field in data plane ACL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some unit test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
…9295) #### Why I did it Fixing issue #9294 #### How I did it Updating ACL yang model #### How to verify it Validating issue with `config patch-apply` is fixed. - Start a KVM - Add file `add-ctrl-plane-tbl.json-patch ` with content: ```json [ { "op": "add", "path": "/ACL_TABLE/ACTRLPLANETABLE", "value": { "policy_desc": "ACTRLPLANETABLE", "services": [ "SSH" ], "stage": "ingress", "type": "CTRLPLANE" } } ] ``` - Run `sudo config apply-patch add-ctrl-plane-tbl.json-patch` Before: ``` Patch Applier: The patch was sorted into 4 changes: Patch Applier: * [{"op": "add", "path": "/ACL_TABLE/ACTRLPLANETABLE", "value": {"type": "CTRLPLANE"}}] Patch Applier: * [{"op": "add", "path": "/ACL_TABLE/ACTRLPLANETABLE/policy_desc", "value": "ACTRLPLANETABLE"}] Patch Applier: * [{"op": "add", "path": "/ACL_TABLE/ACTRLPLANETABLE/services", "value": ["SSH"]}] Patch Applier: * [{"op": "add", "path": "/ACL_TABLE/ACTRLPLANETABLE/stage", "value": "ingress"}] ``` After: ``` Patch Applier: The patch was sorted into 1 change: Patch Applier: * [{"op": "add", "path": "/ACL_TABLE/ACTRLPLANETABLE", "value": {"policy_desc": "ACTRLPLANETABLE", "services": ["SSH"], "stage": "ingress", "type": "CTRLPLANE"}}] ``` #### 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 #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> #### A picture of a cute animal (not mandatory but encouraged)
Why I did it
Fixing issue #9294
How I did it
Updating ACL yang model
How to verify it
Validating issue with
config patch-apply
is fixed.add-ctrl-plane-tbl.json-patch
with content:sudo config apply-patch add-ctrl-plane-tbl.json-patch
Before:
After:
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)