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
oci: cleanup log path if the container failed to create #5800
Conversation
b81d330
to
08f337a
Compare
08f337a
to
c838823
Compare
|
integration failure: |
c838823
to
7eabdf2
Compare
oopsies, inverted boolean expression |
|
lgtm |
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
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, mrunalp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick release-1.23 |
|
@rphillips: once the present PR merges, I will cherry-pick it on top of release-1.23 in a new PR and assign it to you. 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 kubernetes/test-infra repository. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
7 similar comments
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
@haircommander - the kata-jenkins job keeps failing on the test you added. The cleanup code you added in runtime_vm.go should have removed the first at least right? |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
How can we prevent Github from repeating a CI job again and again? |
|
/hold Will do the trick |
internal/oci/runtime_vm.go
Outdated
| @@ -749,6 +749,9 @@ func (r *runtimeVM) createContainerIO(ctx context.Context, c *Container, cioOpts | |||
| defer func() { | |||
| if retErr != nil { | |||
| containerIO.Close() | |||
| if err := os.Remove(c.logPath); err != nil { | |||
| log.Warnf(ctx, "Failed to remove log path %s after failed to create container: %v", c.logPath, 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.
Should this be in CreateContainer() rather than createContainerIO() ?
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.
hahaha right! fixed 😅
7eabdf2
to
303f385
Compare
internal/oci/runtime_oci.go
Outdated
| defer func() { | ||
| if retErr != nil { | ||
| if err := os.Remove(c.logPath); err != nil { | ||
| log.Warnf(ctx, "Failed to remove log path %s after failed to create container: %v", c.logPath, 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.
nit
| log.Warnf(ctx, "Failed to remove log path %s after failed to create container: %v", c.logPath, err) | |
| log.Warnf(ctx, "Failed to remove log path %s after failure to create container: %v", c.logPath, err) |
or perhaps "failing"
internal/oci/runtime_vm.go
Outdated
| @@ -134,6 +134,9 @@ func (r *runtimeVM) CreateContainer(ctx context.Context, c *Container, cgroupPar | |||
| if cleanupErr := r.deleteContainer(c, true); cleanupErr != nil { | |||
| log.Infof(ctx, "DeleteContainer failed for container %s: %v", c.ID(), cleanupErr) | |||
| } | |||
| if err := os.Remove(c.logPath); err != nil { | |||
| log.Warnf(ctx, "Failed to remove log path %s after failed to create container: %v", c.logPath, 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.
if you change prior, change there too.
0db01ee
to
d6783f9
Compare
|
/hold cancel rebased to fix ci PTAL @cri-o/cri-o-maintainers |
|
/hold cancel |
d6783f9
to
19d7851
Compare
Signed-off-by: Peter Hunt <pehunt@redhat.com>
19d7851
to
54912d7
Compare
|
/retest |
|
/lgtm |
|
@rphillips: new pull request created: #5817 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 kubernetes/test-infra repository. |
Signed-off-by: Peter Hunt pehunt@redhat.com
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?