containers / podman

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

API v2: force delete a container #6260

Closed Edward5hen closed 4 years ago

Edward5hen commented 4 years ago

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

/kind bug

Description Force delete a running container by API v2 following the doc seems not to work.

Steps to reproduce the issue:

  1. setup the API v2 service.

  2. podman run --name testctn -d alpine sleep 1000

  3. curl -v -X DELETE -H 'Content-type:application/json' -d '{"force":true}' http://localhost:8081/v1.40/libpod/containers/testctn

Describe the results you received: [root@Fedora31 ~]# curl -v -X DELETE -H 'Content-type:application/json' -d '{"force":true}' http://localhost:8081/v1.40/libpod/containers/testctn

Describe the results you expected: The running container should be removed just as podman rm -f does. Is the curl command correct when I want to use API v2 DELETE method with the payload?

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

Output of podman version:

[root@Fedora31 ~]# podman version
Version:            1.9.1
RemoteAPI Version:  1
Go Version:         go1.13.9
Built:              Mon May 11 06:37:25 2020
OS/Arch:            linux/amd64

Output of podman info --debug:

[root@Fedora31 ~]# podman info --debug
debug:
  compiler: gc
  gitCommit: ""
  goVersion: go1.13.9
  podmanVersion: 1.9.1
host:
  arch: amd64
  buildahVersion: 1.14.8
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.15-1.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.15, commit: 4152e6044da92e0c5f246e5adf14c85f41443759'
  cpus: 2
  distribution:
    distribution: fedora
    version: "31"
  eventLogger: file
  hostname: Fedora31
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.3.7-301.fc31.x86_64
  memFree: 769220608
  memTotal: 2077401088
  ociRuntime:
    name: crun
    package: crun-0.13-2.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.13
      commit: e79e4de4ac16da0ce48777afb72c6241de870525
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  rootless: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 2204889088
  swapTotal: 2214588416
  uptime: 145h 17m 7.28s (Approximately 6.04 days)
registries:
  search:
  - docker.io
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - quay.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 0
    stopped: 1
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 1
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes

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

Edward5hen commented 4 years ago

I'm closing this, I mistaken the query parameters as payload. Sorry about this.