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

Podman driver doesn't remove volume or network on delete #9705

Closed
afbjorklund opened this issue Nov 14, 2020 · 4 comments · Fixed by #10435
Closed

Podman driver doesn't remove volume or network on delete #9705

afbjorklund opened this issue Nov 14, 2020 · 4 comments · Fixed by #10435
Labels
co/podman-driver podman driver issues kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@afbjorklund
Copy link
Collaborator

This makes the next create attempt fail:

🤦  StartHost failed, but will try again: creating host: create: creating: setting up container node: creating volume for minikube container: sudo -n podman volume create minikube --label name.minikube.sigs.k8s.io=minikube --label created_by.minikube.sigs.k8s.io=true: exit status 125
stdout:

stderr:
Error: volume with name minikube already exists: volume already exists

🔄  Restarting existing podman container for "minikube" ...
😿  Failed to start podman container. Running "minikube delete" may fix it: podman inspect ip minikube: sudo -n podman container inspect -f {{.NetworkSettings.IPAddress}} minikube: exit status 125
stdout:

stderr:
Error: error inspecting object: no such container minikube
@afbjorklund afbjorklund added kind/bug Categorizes issue or PR as related to a bug. co/podman-driver podman driver issues labels Nov 14, 2020
@afbjorklund
Copy link
Collaborator Author

The filter option is failing, for some reason:

$ sudo -n podman volume ls --filter label=name.minikube.sigs.k8s.io=minikube
$ sudo -n podman volume ls 
DRIVER      VOLUME NAME
local       minikube
$ sudo -n podman volume inspect minikube
[
     {
          "Name": "minikube",
          "Driver": "local",
          "Mountpoint": "/var/lib/containers/storage/volumes/minikube/_data",
          "CreatedAt": "2020-11-14T15:13:11.855745076+01:00",
          "Labels": {
               "created_by.minikube.sigs.k8s.io": "true",
               "name.minikube.sigs.k8s.io": "minikube"
          },
          "Scope": "local",
          "Options": {
               
          },
          "UID": 0,
          "GID": 0,
          "Anonymous": false
     }
]
$ podman version
Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.15.2
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

@afbjorklund
Copy link
Collaborator Author

It works OK in the docker driver:

$ docker volume ls --filter label=name.minikube.sigs.k8s.io=minikube
DRIVER              VOLUME NAME
local               minikube
$ docker volume inspect minikube
[
    {
        "CreatedAt": "2020-11-14T15:22:40+01:00",
        "Driver": "local",
        "Labels": {
            "created_by.minikube.sigs.k8s.io": "true",
            "name.minikube.sigs.k8s.io": "minikube"
        },
        "Mountpoint": "/var/lib/docker/volumes/minikube/_data",
        "Name": "minikube",
        "Options": {},
        "Scope": "local"
    }
]

So it looks like a bug in podman.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Nov 14, 2020

Reported upstream as containers/podman#8341

The workaround is to remove the volume explicitly, after doing minikube delete

sudo podman volume rm minikube

Maybe minikube should remove the volumes explicitly too, like it creates them ?

@priyawadhwa priyawadhwa added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Nov 30, 2020
@afbjorklund
Copy link
Collaborator Author

As mentioned in #9714, this cleanup now also applies to the created network.

sudo podman network rm minikube

@afbjorklund afbjorklund changed the title Podman driver doesn't remove volume on delete Podman driver doesn't remove volume or network on delete Dec 5, 2020
@afbjorklund afbjorklund added this to the v1.18.0-candidate milestone Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/podman-driver podman driver issues kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants