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

Make temporary names container/image specific #2045

Merged
merged 1 commit into from
Jul 17, 2023
Merged

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jul 16, 2023

If you hit Ctr-C while pulling an image files and directories get left in /var/tmp. By adding "containers_images" prefix, we can use systemd tmpfiles handling to remove them on reboot safely.

Help to make containers/podman#19201 safer.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Idea SGTM

Build needs massaging:

oci/archive/oci_transport.go:163:40: cannot use dir (variable of type *os.File) as string value in argument to ocilayout.NewReference
oci/archive/oci_transport.go:168:45: cannot use dir (variable of type *os.File) as string value in struct literal

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

Thanks, this makes sense to me.


Separately, it could be interesting for Podman or callers to turn Ctrl-C into a context cancellation, to trigger a correct cleanup. OTOH that would be a major change… and IIRC the typical io.Copy (not involving HTTP) is not cancellable, so slow on-disk operations would not stop immediately.

internal/tmpdir/tmpdir.go Outdated Show resolved Hide resolved
internal/tmpdir/tmpdir_test.go Outdated Show resolved Hide resolved
internal/tmpdir/tmpdir_test.go Show resolved Hide resolved
If you hit Ctr-C while pulling an image files and directories get
left in /var/tmp. By adding "containers_images" prefix, we can use
systemd tmpfiles handling to remove them on reboot safely.

Help to make containers/podman#19201 safer.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@mtrmac mtrmac merged commit ecebce9 into containers:main Jul 17, 2023
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.

3 participants