-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
put block/unblock network function into util #20458
Conversation
@bprashanth Not sure if this is what you wanted. Or we can do something like this: type netsplitHelper struct{from string, to string}
func (n netsplitHelper) block()
func (n netsplitHelper) unblock() |
Labelling this PR as size/M |
Great thanks! I'll take a look later today |
// ... | ||
// } | ||
// | ||
func blockNetwork(from string, to string) { |
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.
add a word of caution around using dns names?
I had initially suggested a type so you can do something like https://github.com/kubernetes/kubernetes/blob/master/test/e2e/daemon_restart.go#L78, but eitherway is fine. If you want to leave it as is, this LGTM |
Logf("block network traffic from %s to %s", from, to) | ||
iptablesRule := fmt.Sprintf("OUTPUT --destination %s --jump REJECT", to) | ||
dropCmd := fmt.Sprintf("sudo iptables --insert %s", iptablesRule) | ||
if result, err := SSH(dropCmd, from, testContext.Provider); result.Code != 0 || err != nil { |
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.
nit: probably 100% of the people who use this are going to poll till node NotReady right after, and then poll till NodeReady after recovery, so maybe encapsulate that too?
GCE e2e test build/test passed for commit 048f0681fdacda27dddfe85a7d9ae17ae6606c1e. |
PR needs rebase |
GCE e2e test build/test passed for commit ce7d7e77af1afc91eec81b499f33bcbcc339a4f7. |
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
GCE e2e test build/test passed for commit daef729e4becbd374f3edeb9b95c038823cc4b22. |
GCE e2e build/test failed for commit 52601516fbbf21b57715bef13333428b17c5e057. |
GCE e2e test build/test passed for commit 52601516fbbf21b57715bef13333428b17c5e057. |
GCE e2e test build/test passed for commit 7823d61. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 7823d61. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
No description provided.