-
Notifications
You must be signed in to change notification settings - Fork 950
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: skip teardown network, if the sandbox has been stopped #1539
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1539 +/- ##
==========================================
- Coverage 41.25% 38.36% -2.89%
==========================================
Files 255 257 +2
Lines 16837 17691 +854
==========================================
- Hits 6946 6788 -158
- Misses 9024 10038 +1014
+ Partials 867 865 -2
|
@allencloud PTAL |
cri/v1alpha1/cri.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
} else if !os.IsNotExist(err) { | ||
return nil, 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.
In order to add more information in the error, could we use pkgerrors.Wrap
to wrap the error? WDYT?
cri/v1alpha1/cri.go
Outdated
return nil, err | ||
} | ||
// If the sandbox has been closed, the corresponding network namespace |
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.
Could we put the comment on the top?
cri/v1alpha2/cri.go
Outdated
return nil, err | ||
} | ||
// If the sandbox has been closed, the corresponding network namespace |
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.
Could we put the comment on the top of if
? if not, it seems that we delete the code but not comment. 😄
cri/v1alpha2/cri.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
} else if !os.IsNotExist(err) { | ||
return nil, 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.
use pkgerrors.Wrap
to show the error which means that the file has been removed. WDYT?
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
@fuweid Updated. |
LGTM |
Signed-off-by: YaoZengzeng yaozengzeng@zju.edu.cn
Ⅰ. Describe what this PR did
Please refer: #1536
When stop the sandbox, if the network namespace file of the sandbox does not exist, skip tearing down the pod network.
Ⅱ. Does this pull request fix one issue?
fixes #1536
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews