-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add NetworkPolicy API Resource #25638
Add NetworkPolicy API Resource #25638
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
This is currently "almost working". I can see the new policy/v1beta1/networkpolicy resource, but I can't POST to the API endpoint. I haven't yet been able to track down the issue. I get the following, even though the json I've passed in does define "metadata.name".
|
|
||
// This NetworkPolicyIngressRule matches traffic if and only if the traffic matches both Ports AND From. | ||
type NetworkPolicyIngressRule struct { | ||
// List of ports which should be made accessible on the pods selected by PodSelector. |
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.
s/by PodSelector/for this rule/ - don't reference fields outside the current object.
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.
The proposal doc had lots of good comments - what happened? Specifically "if not provided, match all" and "if empty match none", although we can't really implement that. Go conflates empty and non-specified with "omitempty". I think we can only say that unspecified or empty means no ports are allowed.
We can make it a pointer to slice, if we want to keep the semantic. https://play.golang.org/p/-yCdDclY7_
@thockin - Found the problem. Autogen seems to have messed up - types.generated.go is missing after that latest rebase.... Fix on the way. |
CLAs look good, thanks! |
go home @googlebot, you're drunk |
a9b51d7
to
47248f3
Compare
CLAs look good, thanks! |
My CLA is so fine. Hopefully the code is this time as well... |
CLAs look good, thanks! |
@k8s-bot test this: github issue #IGNORE I have no idea which flake it is - the logs are utterly useless |
2 similar comments
@k8s-bot test this: github issue #IGNORE I have no idea which flake it is - the logs are utterly useless |
@k8s-bot test this: github issue #IGNORE I have no idea which flake it is - the logs are utterly useless |
Tagged with ok-to-merge |
GCE e2e build/test passed for commit 47248f3. |
Automatic merge from submit-queue |
Automatic merge from submit-queue Add e2e network policy tests. **What this PR does / why we need it**: Add set of e2e tests for Network Policy. This has succesfully run againast a deployment using Calico as the network policy provider. Specifically, adds a new e2e test file (/test/e2e/network_policy.go) which tests TCP connectivity between pods with isolation. See #25638 for PR that added NetworkPolicy resource. This PR is a replacement for #27447 .
API implementation of #24154
Still to do:
Next Steps:
Ports
+From
pointers to slices (TODOs in code - to be done when auto-gen is fixed)CC @thockin