-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Added support for project network isolation #10365
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
Added support for project network isolation #10365
Conversation
50fe5b2
to
6548c75
Compare
@openshift/networking PTAL |
value, ok := netns.Annotations[ChangePodNetworkAnnotation] | ||
if !ok { | ||
return PodNetworkAction(""), "", ErrorPodNetworkAnnotationNotFound | ||
} |
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.
you don't need the nil check; if it's nil, then "value, ok := ..." will return ok=false
5f76b19
to
5c69e9f
Compare
[test] |
netIDRange, err := pnetid.NewNetIDRange(osapi.MinVNID, osapi.MaxVNID-osapi.MinVNID+1) | ||
if err != nil { | ||
return nil, fmt.Errorf("unable to create NetID range: %v", err) | ||
} |
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.
You can only get an error here if there's a problem with the MinVNID/MaxVNID constants, which could never happen in production. So just panic if you get an error, and then newMasterVNIDMap() doesn't need to return an error.
(Also, maybe make NetNetIDRange() take min,max rather than min,size?)
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.
done
LGTM other than noted. Not sure what's up with the test failure. |
ChangePodNetworkAnnotation will be processed by the SDN master controller. SDN master controller provides synchronization when manipulating vnids for namespaces.
- Split vnids.go based on master and node roles - Use netID allocator interface (bitmap instead of integer map) - Use ChangePodNetworkAnnotation on NetNamespace for VNID manipulation - Synchronize add/delete/update VNID operations - Added support for exposing project network isolation
…d of updating VNID directly This will ensure VNID is synchronized across add/delete/update operations.
5c69e9f
to
419be05
Compare
419be05
to
047c65d
Compare
Evaluated for origin test up to 047c65d |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7944/) |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8067/) (Image: devenv-rhel7_4856) |
Evaluated for origin merge up to 047c65d |
Docs PR: openshift/openshift-docs#2673 |
Trello card: https://trello.com/c/RrVYvOJj/30-3-support-admin-cli-cmd-to-isolate-projects-sdn-functionality