-
Notifications
You must be signed in to change notification settings - Fork 11
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
Changes for local network policies #572
Conversation
mchalla
commented
Jun 23, 2024
- Implemented on top of Genie changes from Tom
- Add the following classes class[gbpe/LocalL24Classifier] class[gbp/LocalSecGroup] class[gbp/LocalSecGroupSubject] class[gbp/LocalSecGroupRule] class[gbp/LocalAllowDenyAction] class[gbp/LocalSubnets] class[gbp/LocalSubnet]
- These are enabled via opflex.enable-local-netpol config variable and read from .netpol files in the netpol-sources.filesystem thats configured in the opflex config (Default localnetpol is disabled)
- Each security group will contain a .netpol json file containing corresponding netpol
- The implemenation will read these files and update the MODB via the read that then triggers callbacks. These will be the old callbacks in the policymanager that have been extended to also process the Local network policies.
- Add new classtype LOCAL_POLICY to differentiate between POLICY that is always assumed as remote and would trigger a resolveObj
- extend deserialize to support local ObjectInstances, currently it assumes its only called for remote ones.
- add LocalAllowDenyAction on startup since this is the only MO shared across netpols and should never be deleted.
- Implement delete by saving the notifs during add. File based delete will not work without some state because the file notification happens after the file is deleted.
India team still testing. DO NOT MERGE. |
b8f4b59
to
2cc97df
Compare
2cc97df
to
58240ef
Compare
3149872
to
c003fe7
Compare
c003fe7
to
3999270
Compare
3999270
to
f12e3fa
Compare
f12e3fa
to
b4568cb
Compare
5455ed5
to
ba25800
Compare
ba25800
to
3c13467
Compare
1cfb816
to
c1fbbb8
Compare
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.
Just some nits
@@ -173,6 +177,18 @@ private static boolean isPolicy(MClass aIn) | |||
return aIn.isSubclassOf("policy/Component") || aIn.isSubclassOf("policy/Definition"); | |||
} | |||
|
|||
private static boolean isLocalPolicy(MClass aIn) | |||
{ | |||
return aIn.isInstanceOf("gbpe/LocalL24Classifier") |
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.
What do you think about checking isPolicy(aIn) and then just looking for Local at the start of the class name instead of listing them all individually. We could just say that's the convention going forward for any local policy
I can handle this in a followup PR if you think it makes sense
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.
yea thats a good idea. thanks.
genie/src/main/java/org/opendaylight/opflex/genie/content/format/proxy/meta/cpp/FMetaDef.java
Outdated
Show resolved
Hide resolved
- Implemented on top of Genie changes from Tom - Add the following classes class[gbpe/LocalL24Classifier] class[gbp/LocalSecGroup] class[gbp/LocalSecGroupSubject] class[gbp/LocalSecGroupRule] class[gbp/LocalAllowDenyAction] class[gbp/LocalLogAction] class[gbp/LocalSubnets] class[gbp/LocalSubnet] - These are enabled via opflex.enable-local-netpol config variable and read from .netpol files in the netpol-sources.filesystem thats configured in the opflex config (Default localnetpol is disabled) - Each security group will contain a .netpol json file containing corresponding netpol - The implemenation will read these files and update the MODB via the read that then triggers callbacks. These will be the old callbacks in the policymanager that have been extended to also process the Local network policies. - Add new classtype LOCAL_POLICY to differentiate between POLICY that is always assumed as remote and would trigger a resolveObj - extend deserialize to support local ObjectInstances, currently it assumes its only called for remote ones. - add LocalAllowDenyAction and LocalLogAction on startup since these MOs are shared across netpols and should never be deleted. This is added in common tenant and one is created at startup. - Implement delete by saving the notifs during add. File based delete will not work without some state because the file notification happens after the file is deleted. Signed-off-by: Madhu Challa <challa@gmail.com>
c1fbbb8
to
dab0a5c
Compare