-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Kubernetes NetworkPolicy fixes & enhancements #638
Conversation
The goal is to isolate all Kubernetes specific code in this package over time. Signed-off-by: Thomas Graf <thomas@cilium.io>
New LabelArray type with Contains() function to implement functionality to require multiple labels as a set. Signed-off-by: Thomas Graf <thomas@cilium.io>
Modifies the AllowRule to take a set of labels which are required to be present. Backwards compatibility is maintained, if a single label is provided, it will be converted into a set containing a single label. Signed-off-by: Thomas Graf <thomas@cilium.io>
Fix NetworkPolicy implementation to correctly handle the matchLabels by requiring all labels. Adds a unit test to verify the behaviour. Signed-off-by: Thomas Graf <thomas@cilium.io>
// List of sources which should be able to access the pods selected for this rule. // Items in this list are combined using a logical OR operation. // If this field is empty or missing, this rule matches all sources (traffic not restricted by source). // If this field is present and contains at least on item, this rule allows traffic only if the // traffic matches at least one item in the from list. // +optional From []NetworkPolicyPeer Signed-off-by: Thomas Graf <thomas@cilium.io>
Supports v1beta1.NetworkPolicyPort as part of NetworkPolicy and converts it into ingress RuleL4 rules. Signed-off-by: Thomas Graf <thomas@cilium.io>
type ConsumableDecision byte | ||
|
||
const ( | ||
// UNDECIDED means unsed while the decision is still undecided |
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.
unsed? undecided about what? please clarify in the comment.
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.
Undecided means that the policy decision has not been made yet. I haven't introduced this code in this commit, I've just moved it into a separate package.
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.
Noted, thanks.
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.
Core changes look good, as does the refactoring.
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.
lgtm
No description provided.