[yang-models] Validating 'services' exist if ACL type is 'CTRLPLANE'#9295
Merged
ghooo merged 2 commits intosonic-net:masterfrom Dec 10, 2021
Merged
[yang-models] Validating 'services' exist if ACL type is 'CTRLPLANE'#9295ghooo merged 2 commits intosonic-net:masterfrom
ghooo merged 2 commits intosonic-net:masterfrom
Conversation
Contributor
Author
|
there is a build error, i think i will fix it and a unit-test |
Collaborator
|
Can you please add UT to cover this case? |
Contributor
|
Issue #9294 is fixed from my mannually test. |
qiluo-msft
reviewed
Nov 18, 2021
| type string; | ||
| } | ||
|
|
||
| must "(type != 'CTRLPLANE') or (boolean(services))"; |
Collaborator
There was a problem hiding this comment.
Add some comment to explain the constrain? #Closed
Collaborator
There was a problem hiding this comment.
@bingwang-ms Do we require service field in data plane ACL?
qiluo-msft
previously approved these changes
Dec 9, 2021
qiluo-msft
approved these changes
Dec 9, 2021
ganglyu
approved these changes
Dec 10, 2021
wen587
approved these changes
Dec 10, 2021
judyjoseph
pushed a commit
that referenced
this pull request
Jan 9, 2022
…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)
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
Fixing issue #9294
How I did it
Updating ACL yang model
How to verify it
Validating issue with
config patch-applyis fixed.add-ctrl-plane-tbl.json-patchwith content:[ { "op": "add", "path": "/ACL_TABLE/ACTRLPLANETABLE", "value": { "policy_desc": "ACTRLPLANETABLE", "services": [ "SSH" ], "stage": "ingress", "type": "CTRLPLANE" } } ]sudo config apply-patch add-ctrl-plane-tbl.json-patchBefore:
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)