Skip to content

crane export creates tar even on failure #2066

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

Open
mamachanko opened this issue Feb 19, 2025 · 1 comment · May be fixed by #2067
Open

crane export creates tar even on failure #2066

mamachanko opened this issue Feb 19, 2025 · 1 comment · May be fixed by #2067
Labels
bug Something isn't working

Comments

@mamachanko
Copy link

Describe the bug

A tar file is created even though the image failed to be pulled.

To Reproduce

# fails
crane export does-not-exist x.tar

# succeeds
file x.tar

Expected behavior

When crane export some-image some.tar fails, then it should not create a some.tar.

Additional context

Add any other context about the problem here.

❯ crane version
0.20.3
@mamachanko mamachanko added the bug Something isn't working label Feb 19, 2025
@mamachanko mamachanko changed the title crane: crane export creates tar even on failure Feb 19, 2025
@mamachanko
Copy link
Author

mamachanko commented Feb 19, 2025

The problem appears to be the lack of clean-up in this failure case

return fmt.Errorf("pulling %s: %w", src, err)

@mamachanko mamachanko linked a pull request Feb 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant