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

don't leave empty CIDFile behind #4621

Merged
merged 1 commit into from
Mar 12, 2014
Merged

Conversation

unclejack
Copy link
Contributor

This makes --cidfile clean up empty container ID files. These are left behind when creating the container fails.

This PR adds a test and renames the existing CIDFile tests.

Fixes #3791

@unclejack unclejack added this to the 0.9.1 milestone Mar 12, 2014
defer containerIDFile.Close()
defer func() {
containerIDFile.Close()
var CIDFileInfo os.FileInfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why uppercase?

@unclejack
Copy link
Contributor Author

@crosbymichael I've updated the PR.

defer containerIDFile.Close()
defer func() {
containerIDFile.Close()
var cidFileInfo os.FileInfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can group these in

var (

)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done.

This makes `--cidfile` clean up empty container ID files. These are
left behind when creating the container fails.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
@crosbymichael
Copy link
Contributor

LGTM

1 similar comment
@vieux
Copy link
Contributor

vieux commented Mar 12, 2014

LGTM

vieux added a commit that referenced this pull request Mar 12, 2014
@vieux vieux merged commit bd1c512 into moby:master Mar 12, 2014
@unclejack unclejack deleted the fix_empty_cidfile branch March 12, 2014 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed docker run command leaves zero-length cidfile on disk, blocks subsequent docker run
3 participants