Skip to content

APIv2: querying images containing slashes does not work #5229

@schubter

Description

@schubter

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

/kind bug

i have a few images stored, and can verify having them available on the images endpoint

curl -s --unix-socket /run/podman/podman.sock http://d/v1.25/images/json | jq -r 
[
  {
    "Containers": 2,
    "Created": 1572639590,
    "Id": "54e71dcafb7cda8aeb3aadd39d4b13a3ea178744f3321ff273a33315dbfd6118",
    "Labels": null,
    "ParentId": "",
    "RepoDigests": [
      "sha256:80bf73289b856e9a9cb518e76380575b4328b031dd9f593c7c7b3c75c5598048"
    ],
    "RepoTags": [
      "docker.io/library/golang:latest"
    ],
    "SharedSize": 0,
    "Size": 823356249,
    "VirtualSize": 823356249,
    "CreatedTime": "0001-01-01T00:00:00Z"
  },
  {
    "Containers": 0,
    "Created": 1572639770,
    "Id": "bc0268f5ce476aac87e4ac36f83cc1181e8430eabee2d7aed09768d8fd40d9b9",
    "Labels": null,
    "ParentId": "",
    "RepoDigests": [
      "sha256:57dada78eedf541fc996abe16d11f021a084048a3ad90bcb78af89c1d321e490"
    ],
    "RepoTags": [
      "docker.io/library/golang:1.12"
    ],
    "SharedSize": 0,
    "Size": 834579802,
    "VirtualSize": 834579802,
    "CreatedTime": "0001-01-01T00:00:00Z"
  },

however, querying them is not possible, as it contains a forward slash

curl -s --unix-socket /run/podman/podman.sock http://d/v1.25/images/library/golang:1.12/json
Not Found

if I replace the forward slash between library and Golang with %2F it works as expected

curl -s --unix-socket /run/podman/podman.sock http://d/v1.25/images/library%2Fgolang:1.12/json
{"Id":"sha256:bc0268f5ce476aac87e4ac36f83cc1181e8430eabee2d7aed09768d8fd40d9b9","RepoTags":["docker.io/library/golang:1.12"],"RepoDigests":["docker.io/library/golang@sha256:57dada78eedf541fc996abe16d11f021a084048a3ad90bcb78af89c1d321e490"],"Parent":"","Comment":"","Created":"2019-11-01T20:22:50.47452812Z","Container":"9db41b191d0eb076e87a07b82902bbb324a8ef60c96f639ad366e246f5ef764a","ContainerConfig":{"Hostname":"9db41b191d0e","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","GOLANG_VERSION=1.12.13","GOPATH=/go"],"Cmd":["/bin/sh","-c","#(nop) WORKDIR /go"],"ArgsEscaped":true,"Image":"sha256:339518f1bacc8e236b7125fef66e1f5ace73bbae6435e2187ab9cc1082ef340e","Volumes":null,"WorkingDir":"/go","Entrypoint":null,"OnBuild":null,"Labels":{}},"DockerVersion":"","Author":"","Config":{"Hostname":"","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","GOLANG_VERSION=1.12.13","GOPATH=/go"],"Cmd":["bash"],"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"","Os":"","Size":834579802,"VirtualSize":834579802,"GraphDriver":{"Data":null,"Name":""},"RootFS":{"Type":""},"Metadata":{"LastTagTime":"0001-01-01T00:00:00Z"}}

Describe the results you received:

NotFound

Describe the results you expected:

json detailing the image

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

Output of podman version:

Version:            1.8.1-dev
RemoteAPI Version:  1
Go Version:         go1.12.13
Git Commit:         ff0f8388138f7b66c4312db0e984f0bedcac2558
Built:              Mon Feb 17 09:59:40 2020
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ff0f8388138f7b66c4312db0e984f0bedcac2558
  go version: go1.12.13
  podman version: 1.8.1-dev
host:
  BuildahVersion: 1.13.1
  CgroupVersion: v1
  Conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.10, commit: unknown'
  Distribution:
    distribution: debian
    version: "10"
  MemFree: 111472640
  MemTotal: 4138446848
  OCIRuntime:
    name: runc
    package: 'runc: /usr/sbin/runc'
    path: /usr/sbin/runc
    version: |-
      runc version 1.0.0~rc6+dfsg1
      commit: 1.0.0~rc6+dfsg1-3
      spec: 1.0.1
  SwapFree: 3656359936
  SwapTotal: 4138442752
  arch: amd64
  cpus: 2
  eventlogger: journald
  hostname: hst-m04.dc.burg-1.de
  kernel: 4.19.0-6-amd64
  os: linux
  rootless: false
  uptime: 1935h 13m 35.37s (Approximately 80.62 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 5
  GraphDriverName: overlay
  GraphOptions: {}
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 37
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions