containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.74k stars 2.41k forks source link

'volume rm' removes an arbitrary volume if the volume name is ambiguous #3635

Closed undecaf closed 5 years ago

undecaf commented 5 years ago

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

If there are multiple volumes whose names start with the same character(s) (such as a1, a2) then podman volume rm a removes one of these volumes although a is ambiguous. This concerns named volumes as well as volumes identified by their hashes.

Steps to reproduce the issue:

  1. podman volume create a1
    podman volume create a2

  2. podman volume rm a

Describe the results you received: Either volume a1 or a2 is removed.

Describe the results you expected: Podman should not remove any volume. Instead it should complain about the ambiguous volume name.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:            1.4.3
RemoteAPI Version:  1
Go Version:         go1.10.4
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.10.4
  podman version: 1.4.3
host:
  BuildahVersion: 1.9.0
  Conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 1.0.0-rc2, commit: unknown'
  Distribution:
    distribution: ubuntu
    version: "18.04"
  MemFree: 5768183808
  MemTotal: 8050257920
  OCIRuntime:
    package: 'cri-o-runc: /usr/bin/runc'
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.1-dev'
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 4
  hostname: hestia
  kernel: 4.18.0-25-generic
  os: linux
  rootless: true
  uptime: 30m 34.8s
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/kasper/.config/containers/storage.conf
  ContainerStore:
    number: 6
  GraphDriverName: vfs
  GraphOptions: null
  GraphRoot: /home/kasper/.local/share/containers/storage
  GraphStatus: {}
  ImageStore:
    number: 19
  RunRoot: /tmp/1000
  VolumePath: /home/kasper/.local/share/containers/storage/volumes

Additional environment details (AWS, VirtualBox, physical, etc.):

$ uname -a
Linux hestia 4.18.0-25-generic #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
mheon commented 5 years ago

I'll take this one - pretty sure I know where the problem is.

mheon commented 5 years ago

3641 to fix

undecaf commented 5 years ago

Thank you!