-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NetworkPolicyReference to controlplane NetworkPolicy
NetworkPolicy in controlplane API group is the object that consumed by antrea-agents. Both Antrea NetworkPolicy and K8s NetworkPolicy will be converted to it. Currently, the namespace and name of the original NetworkPolicy are copied to the controlplane NetworkPolicy and <Namespace>/<Name> is used as the key func. Therefore, one K8s NetworkPolicy may overwrite the controlplane NetworkPolicy mapping to a Antrea NetworkPolicy that has the same namespace and name. To fix it completely, the original NetworkPolicy name will not be used as the controlplane NetworkPolicy name directly. However, antrea-agents still need to know the information about the original NetworkPolicy for multiple purposes, e.g. metrics and realization status report, and traceflow observation correlation. To keep backward compatibility, this patch adds a new field "SourceRef" that includes the information about the original NetworkPolicy to the struct of controlplane NetworkPolicy. Instead of assuming controlplane NetworkPolicy has the same name as the original NetworkPolicy, antrea-agents consumes the new field to get the information about the original NetworkPolicy.
- Loading branch information
Showing
31 changed files
with
1,168 additions
and
363 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.