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

[APIv2] push: query parameter tag does not work #6388

Closed
Edward5hen opened this issue May 26, 2020 · 3 comments · Fixed by #6403
Closed

[APIv2] push: query parameter tag does not work #6388

Edward5hen opened this issue May 26, 2020 · 3 comments · Fixed by #6403
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

@Edward5hen
Copy link
Contributor

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

/kind bug

Description
The steps are just like issue #6384 , the difference is using a different tag mytag in step 2. Although #6207 is still not merged, I should have the same response after I assign mytag to query parameter tag in the URL, but I got a 404 - "no such image".

Steps to reproduce the issue:

  1. podman tag alpine docker.io/edwardf0cus/testrepo:mytag
    
  2. XRA=`echo "{ \"username\": \"edwardf0cus\", \"password\": \"mypassword\", \"email\": \"[email protected]\", \"serveraddress\":\"docker.io\"}" | base64 --wrap=0`
    
  3. curl -v -X POST -H "X-Registry-Auth: $XRA" "http://localhost:8081/v1.40/libpod/images/docker.io/edwardf0cus/testrepo/push?tag=mytag"
    

Describe the results you received:

# curl -v -X POST -H "X-Registry-Auth: $XRA" "http://localhost:8081/v1.40/libpod/images/docker.io/edwardf0cus/testrepo/push?tag=mytag"
*   Trying ::1:8081...
* connect to ::1 port 8081 failed: Connection refused
*   Trying 127.0.0.1:8081...
* Connected to localhost (127.0.0.1) port 8081 (#0)
> POST /v1.40/libpod/images/docker.io/edwardf0cus/testrepo/push?tag=mytag HTTP/1.1
> Host: localhost:8081
> User-Agent: curl/7.69.1
> Accept: */*
> X-Registry-Auth: eyAidXNlcm5hbWUiOiAiZWR3YXJkZjBjdXMiLCAicGFzc3dvcmQiOiAiamhfMDI2MTM3IiwgImVtYWlsIjogInNoZW53ZWk2MDRAMTI2LmNvbSIsICJzZXJ2ZXJhZGRyZXNzIjoiZG9ja2VyLmlvIn0K
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Content-Type: application/json
< Date: Tue, 26 May 2020 09:03:42 GMT
< Content-Length: 186
<
{"cause":"no such image","message":"Failed to find image docker.io/edwardf0cus/testrepo: unable to find 'docker.io/edwardf0cus/testrepo' in local storage: no such image","response":404}
* Connection #0 to host localhost left intact

Describe the results you expected:
at least the same as #6384

Additional information you deem important (e.g. issue happens only occasionally):
always
Output of podman version:

[root@localhost libpod]# podman version
Version:      2.0.0-dev
API Version:  1
Go Version:   go1.14.2
Git Commit:   1077d2d0b72d027a01080c0d3ebdb7d99a969661
Built:        Tue May 26 14:51:01 2020
OS/Arch:      linux/amd64

Output of podman info --debug:

[root@localhost libpod]# podman info --debug
host:
  arch: amd64
  buildahVersion: 1.15.0-dev
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.15-1.fc32.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.15, commit: 33da5ef83bf2abc7965fc37980a49d02fdb71826'
  cpus: 2
  distribution:
    distribution: fedora
    version: "32"
  eventLogger: file
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.6.6-300.fc32.x86_64
  linkmode: dynamic
  memFree: 786034688
  memTotal: 2068803584
  ociRuntime:
    name: crun
    package: crun-0.13-2.fc32.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: 2203840512
  swapTotal: 2206199808
  uptime: 25h 37m 42.04s (Approximately 1.04 days)
registries:
  localhost:
    Blocked: false
    Insecure: true
    Location: localhost
    MirrorByDigestOnly: false
    Mirrors: []
    Prefix: localhost
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 1
    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: 2
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 1
  Built: 1590475861
  BuiltTime: Tue May 26 14:51:01 2020
  GitCommit: 1077d2d0b72d027a01080c0d3ebdb7d99a969661
  GoVersion: go1.14.2
  OsArch: linux/amd64
  Version: 2.0.0-dev
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 26, 2020
@vrothberg
Copy link
Member

vrothberg commented May 26, 2020

There is a diff between the docs and the implementation:

While the tag parameter is not implemented, the destination and tlsVerify are not documented.

I vote for not supporting tag as the optional destination parameter offers more flexibility as a local image could be referenced via it's ID (or short name) in the path and be pushed to a completely different registry via the destination parameter.

@baude @jwhonce WDYT?

@baude
Copy link
Member

baude commented May 26, 2020

@vrothberg i cannot say as to historical use of it? maybe get some team consensus from people on this one?

@vrothberg
Copy link
Member

We decided to change the docs to reflect the parameters the libpod endpoint actually supports. Namely, there is a destination parameter which not only allows for changing the tag but the entire destination reference which allows for a remote push $ID quay.io/.... or a remote push docker.io/... quay.io/.... This offers more flexibility.

I just opened #6403 to correct the docs.

vrothberg added a commit to vrothberg/libpod that referenced this issue May 27, 2020
The swagger documentation for the libpod push endpoint were not in sync
with the implementation.  Correct these docs to reflect the parameters
that are actually supported.

Fixes: containers#6388
Signed-off-by: Valentin Rothberg <[email protected]>
snj33v pushed a commit to snj33v/libpod that referenced this issue May 31, 2020
The swagger documentation for the libpod push endpoint were not in sync
with the implementation.  Correct these docs to reflect the parameters
that are actually supported.

Fixes: containers#6388
Signed-off-by: Valentin Rothberg <[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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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