-
Notifications
You must be signed in to change notification settings - Fork 949
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
bugfix: fix remove all endpoints when network disconnect #1284
bugfix: fix remove all endpoints when network disconnect #1284
Conversation
Please change error message more readable.
|
daemon/mgr/network.go
Outdated
logrus.Errorf("failed to delete sandbox id: %s, err: %v", sid, err) | ||
return err | ||
if err != nil || sb == nil { | ||
return errors.Errorf("failed to get sandbox by id(%s)", sid) |
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 we communicate before about how to deal with the err and nil.
First I think we should make sure the API of function SandboxByID
to check if there is possibility of returning both a nil sandbox and nil-err; if it does not and returns an instance of sandbox and nil-err, we could simply judge if err != nil
.
In the code
if err != nil || sb == nil {
return errors.Errorf("failed to get sandbox by id(%s)", sid)
}
It will miss the err message.
return errors.Errorf("not connected to the network(%s)", endpoint.Name) | ||
} | ||
|
||
if err := ep.Leave(sb); 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.
In this pr, you said remove all endpoints when network disconnect
,
However, I found that it only deletes one endpoint. Is it correct?
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 mean the bug is remove all endpoints when network disconnect
, the correct result is just remove the endpoint in this network.
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.
So I think the pr title is some kind of misleading. 😃
Fix remove all endpoints when network disconnect. Signed-off-by: Rudy Zhang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1284 +/- ##
==========================================
- Coverage 16.45% 15.51% -0.95%
==========================================
Files 182 173 -9
Lines 11285 10876 -409
==========================================
- Hits 1857 1687 -170
+ Misses 9292 9070 -222
+ Partials 136 119 -17
|
LGTM |
Ⅰ. Describe what this PR did
Fix remove all endpoints when network disconnect.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
Signed-off-by: Rudy Zhang [email protected]