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

Docker API incompatibility for "volume prune": "until" is an invalid volume filter #10579

Closed
w4tsn opened this issue Jun 7, 2021 · 8 comments · Fixed by #10861
Closed

Docker API incompatibility for "volume prune": "until" is an invalid volume filter #10579

w4tsn opened this issue Jun 7, 2021 · 8 comments · Fixed by #10861
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@w4tsn
Copy link
Contributor

w4tsn commented Jun 7, 2021

/kind bug

Description

The docker API supports the until filter in volume prunes. This is not stated in the official documentation, interestingly enough, but I'm using this flag on the docker cli client without problems. E.g. until=24h.

Steps to reproduce the issue:

Run `podman volume prune --filter until="24h"

Describe the results you received:

Got an error message from the "docker" API socket

An unexpected docker error occurred: 500 Server Error: Internal Server Error (\"failed to parse filters for until=24h: \"until\" is an invalid volume filter\")

Describe the results you expected:

Compatibility of the "until" filter for volume prune, as it is supported by docker - if wider docker API compatibility is desired here.

Output of podman version:

Version:      3.1.2
API Version:  3.1.2
Go Version:   go1.16.3
Built:        Wed May 12 21:27:59 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.20.1
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.27-2.fc34.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 4
  distribution:
    distribution: fedora
    version: "34"
  eventLogger: journald
  hostname: backend05.othermo.de
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.12.8-300.fc34.x86_64
  linkmode: dynamic
  memFree: 15457230848
  memTotal: 16779862016
  ociRuntime:
    name: crun
    package: crun-0.19.1-3.fc34.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.19.1
      commit: 1535fedf0b83fb898d449f9680000f729ba719f5
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 62h 51m 58.74s (Approximately 2.58 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  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: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.1.2
  Built: 1620847679
  BuiltTime: Wed May 12 21:27:59 2021
  GitCommit: ""
  GoVersion: go1.16.3
  OsArch: linux/amd64
  Version: 3.1.2

Package info (e.g. output of rpm -q podman or apt list podman):

podman-3.1.2-3.fc34.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

I did not test with the latest version of podman, but I consulted the guides.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 7, 2021
@mheon
Copy link
Member

mheon commented Jun 7, 2021

Any chance you can try with 3.2.0? I know that @jmguzik has been doing a lot of work on filters for prune, so it's possible he's implemented this already.

@jmguzik
Copy link
Contributor

jmguzik commented Jun 7, 2021

@w4tsn @mheon Docker does not support prune until filter for volume. Please refer to:
https://docs.docker.com/engine/api/v1.41/#operation/VolumePrune
This most likely could be implemented in podman, assuming created time is stored somewhere (did not check).

EDIT: cli supports it so this is a strange situation. Support is undocumented thus missed in podman.

@mheon
Copy link
Member

mheon commented Jun 7, 2021

We do store volume create time, so this ought to be possible.

@jmguzik
Copy link
Contributor

jmguzik commented Jun 7, 2021

We do store volume create time, so this ought to be possible.

If so I can assign to this one to do it in end of this- next week.
/assign

@rhatdan
Copy link
Member

rhatdan commented Jun 7, 2021

You got it.

jmguzik added a commit to jmguzik/podman that referenced this issue Jun 22, 2021
As stated in containers#10579 docker silently implements until filter for volume prune.
This commit adds initial support to the HTTP API, both libpod and compat.
It enables further work on that issue, such as adding cli support in the future.

Signed-off-by: Jakub Guzik <[email protected]>
@github-actions
Copy link

github-actions bot commented Jul 8, 2021

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jul 8, 2021

@jmguzik Any progress?

@jmguzik
Copy link
Contributor

jmguzik commented Jul 8, 2021

In progress. Fighting with one thing, but in http api it's done.
Will be done when I finish #10861

jmguzik added a commit to jmguzik/podman that referenced this issue Jul 26, 2021
This commit follows work started in containers#10756. Changes made in containers#11015
enabled cli support for volume prune --filter until. Adding e2e test
closes containers#10579.

Signed-off-by: Jakub Guzik <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants