-
Notifications
You must be signed in to change notification settings - Fork 63
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
Store iptables when creating network attack #215
Conversation
Signed-off-by: root <root@localhost.localdomain>
Signed-off-by: root <root@localhost.localdomain>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: root <root@localhost.localdomain>
…into fix-partition
@FingerLeader I test this pr on my environment, I found the network delay still cancel when I applied a partition action.
|
I test it again and find it works. Maybe you can delete |
OK, I will test it again |
Signed-off-by: root <root@localhost.localdomain>
@cwen0 I have updated, please have a try again. |
pkg/server/chaosd/network.go
Outdated
@@ -79,11 +79,9 @@ func (networkAttack) Attack(options core.AttackConfig, env Environment) (err err | |||
return perrors.WithStack(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.
We can delete NeedApplyIptables()
and NeedApplyIPSet
directly.
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.
I think leaving them can make the code logic clearly, and they may be needed to add features later (by the way, NeedApplyIPSet()
is working now)
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.
I think the logic will be clearer If we delete them. The logic: Chaos Mesh will reset all network action when you apply the network actions. This logic will be more simple.
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.
OK, I think it's OK to be the same as chaos mesh, NeedApplyIptables
can be deleted, but I find chaosd attack network delay -l 1s -d eth0
will not work without NeedApplyIPSet()
pkg/server/chaosd/network.go
Outdated
if err := env.Chaos.recoverIPSet(env.AttackUid); err != nil { | ||
return perrors.WithStack(err) | ||
} | ||
// `chaosdaemon.DeamonServer.SetTcs()` may build new iptables which will not be recorded in DB, |
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.
We should update this comment.
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.
I don't think this comment should be updated, the filter iptables still not be stored in the DB
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.
Yes, but here we recover all because chaos mesh will apply all network actions when we apply a new one.
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.
I agree
Signed-off-by: root <root@localhost.localdomain>
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.
LGTM
/merge |
@cwen0: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Signed-off-by: root root@localhost.localdomain
Close #213