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

put block/unblock network function into util #20458

Merged
merged 1 commit into from Feb 19, 2016

Conversation

freehan
Copy link
Contributor

@freehan freehan commented Feb 2, 2016

No description provided.

@freehan
Copy link
Contributor Author

freehan commented Feb 2, 2016

@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()

@k8s-github-robot
Copy link

Labelling this PR as size/M

@k8s-github-robot k8s-github-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 2, 2016
@bprashanth
Copy link
Contributor

Great thanks! I'll take a look later today

// ...
// }
//
func blockNetwork(from string, to string) {
Copy link
Contributor

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?

@bprashanth
Copy link
Contributor

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 {
Copy link
Contributor

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?

@k8s-bot
Copy link

k8s-bot commented Feb 2, 2016

GCE e2e test build/test passed for commit 048f0681fdacda27dddfe85a7d9ae17ae6606c1e.

@k8s-github-robot
Copy link

PR needs rebase

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 2, 2016
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 2, 2016
@k8s-bot
Copy link

k8s-bot commented Feb 2, 2016

GCE e2e test build/test passed for commit ce7d7e77af1afc91eec81b499f33bcbcc339a4f7.

@k8s-bot
Copy link

k8s-bot commented Feb 17, 2016

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.

@k8s-bot
Copy link

k8s-bot commented Feb 18, 2016

GCE e2e test build/test passed for commit daef729e4becbd374f3edeb9b95c038823cc4b22.

@k8s-bot
Copy link

k8s-bot commented Feb 18, 2016

GCE e2e build/test failed for commit 52601516fbbf21b57715bef13333428b17c5e057.

@freehan
Copy link
Contributor Author

freehan commented Feb 18, 2016

@k8s-bot test this issue: #21261

@k8s-bot
Copy link

k8s-bot commented Feb 18, 2016

GCE e2e test build/test passed for commit 52601516fbbf21b57715bef13333428b17c5e057.

@k8s-bot
Copy link

k8s-bot commented Feb 19, 2016

GCE e2e test build/test passed for commit 7823d61.

@freehan freehan added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 19, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Feb 19, 2016

GCE e2e test build/test passed for commit 7823d61.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

k8s-github-robot pushed a commit that referenced this pull request Feb 19, 2016
Auto commit by PR queue bot
@k8s-github-robot k8s-github-robot merged commit 2236c84 into kubernetes:master Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants