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

fix: Cleaning up orphaned directories and files when containers creat… #3457

Merged
merged 1 commit into from
Sep 28, 2024

Commits on Sep 28, 2024

  1. fix: Cleaning up orphaned directories and files when containers creat…

    …ion fails
    
    When trying to create new containers, the following directories are
    created based on the new container ID:
    
      - `/var/lib/nerdctl/1935db59/containers/<namespace>/<container id>`
      - `/var/lib/nerdctl/1935db59/etchosts/<namespace>/<container id>`
    
    When containers with existing names are attempted to be created, the
    processes fail.
    However, in the events of failures, these directories are not cleaned up.
    
    This issue is reported in the following:
    
      - containerd#2993
    
    This commit resolves the issue by cleaning up the mentioned directories
    when containers creation fails.
    
    Also, It has also been modified so that the following directory is also
    cleaned up when the container is removed.
    
      - `/var/lib/nerdctl/1935db59/etchosts/<namespace>/<container id>`
    
    Note that tests of logic to fix bug in Issue containerd#2993 are added based on the
    following testing principles.
    
      - https://github.com/containerd/nerdctl/blob/main/docs/testing/tools.md
    
    Signed-off-by: Hayato Kiwata <[email protected]>
    haytok committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    2c2745e View commit details
    Browse the repository at this point in the history