Skip to content
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

Merged
merged 6 commits into from
May 2, 2017
Merged

Kubernetes NetworkPolicy fixes & enhancements #638

merged 6 commits into from
May 2, 2017

Conversation

tgraf
Copy link
Member

@tgraf tgraf commented May 2, 2017

No description provided.

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>
@tgraf tgraf added kind/bug This is a bug in the Cilium logic. kind/enhancement This would improve or streamline existing functionality. labels May 2, 2017
@tgraf tgraf added this to the 0.9 milestone May 2, 2017
@tgraf tgraf requested review from aalemayhu, ianvernon and aanm May 2, 2017 18:29
type ConsumableDecision byte

const (
// UNDECIDED means unsed while the decision is still undecided
Copy link
Member

@ianvernon ianvernon May 2, 2017

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, thanks.

Copy link
Member

@ianvernon ianvernon left a 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.

@tgraf tgraf merged commit e28b82c into master May 2, 2017
@tgraf tgraf deleted the k8s-l4 branch May 2, 2017 23:06
Copy link
Contributor

@aalemayhu aalemayhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic. kind/enhancement This would improve or streamline existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants