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

podman manifest push --rm removes a wrong image #15033

Closed
sstosh opened this issue Jul 22, 2022 · 1 comment · Fixed by #15034
Closed

podman manifest push --rm removes a wrong image #15033

sstosh opened this issue Jul 22, 2022 · 1 comment · Fixed by #15034
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

@sstosh
Copy link
Contributor

sstosh commented Jul 22, 2022

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

/kind bug

Description

This bug is reproduced when we execute the following command:

  1. podman manifest add <manifest list> <images exist on local storage>
  2. podman manifest push --rm <manifest list> dif:<directory>

If pushing succeeds, it is expected to remove only a manifest list.
However, manifest list remains on local storage and images are removed.

Steps to reproduce the issue:

# podman images
REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
quay.io/libpod/testimage  20220615    f26aa69bb3f3  5 weeks ago  8.4 MB

# podman manifest create test
b4f3d14b82134461dd8bd85c24ff2a163e01e1585470d6371ad6dfd832070ac4
# podman manifest add test quay.io/libpod/testimage:20220615
b4f3d14b82134461dd8bd85c24ff2a163e01e1585470d6371ad6dfd832070ac4

# podman images
REPOSITORY                TAG         IMAGE ID      CREATED         SIZE
localhost/test            latest      b4f3d14b8213  12 seconds ago  479 B
quay.io/libpod/testimage  20220615    f26aa69bb3f3  5 weeks ago     8.4 MB

# podman manifest push --rm test dir:/tmp/test1
Getting image list signatures
Copying 1 of 1 images in list
Copying image sha256:a07e678985cd67330fd30a4c8a008cefeb1ca917c25ab0f8468ea17c7b34beb2 (1/1)
Getting image source signatures
Copying blob bfb9a866bc99 done
Copying blob a3ed95caeb02 done
Copying config f26aa69bb3 done
Writing manifest to image destination
Storing signatures
Writing manifest list to image destination
Storing list signatures

Describe the results you received:

Manifest list remains on local storage and testimage are removed.

# podman images
REPOSITORY      TAG         IMAGE ID      CREATED         SIZE
localhost/test  latest      b4f3d14b8213  27 seconds ago  479 B

Describe the results you expected:

Only a manifest list is removed.

# podman images
REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
quay.io/libpod/testimage  20220615    f26aa69bb3f3  5 weeks ago  8.4 MB

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

If podman manifest add chooses a image which are not exist on local storage,
only manifest list are removed.

# podman images
REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
quay.io/libpod/testimage  20220615    f26aa69bb3f3  5 weeks ago  8.4 MB

# podman manifest create test
75fd207807c1570af5e1709d0cec465ae0d8bb539a4a12ef81e93d7c48714500
# podman manifest add test quay.io/libpod/busybox
75fd207807c1570af5e1709d0cec465ae0d8bb539a4a12ef81e93d7c48714500

# podman images
REPOSITORY                TAG         IMAGE ID      CREATED         SIZE
localhost/test            latest      75fd207807c1  18 seconds ago  485 B
quay.io/libpod/testimage  20220615    f26aa69bb3f3  5 weeks ago     8.4 MB

# podman manifest push --rm test dir:/tmp/test1
Getting image list signatures
Copying 1 of 1 images in list
Copying image sha256:c9249fdf56138f0d929e2080ae98ee9cb2946f71498fc1484288e6a935b5e5bc (1/1)
Getting image source signatures
Copying blob 9758c28807f2 done
Copying config f0b02e9d09 done
Writing manifest to image destination
Storing signatures
Writing manifest list to image destination
Storing list signatures

# podman images
REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
quay.io/libpod/testimage  20220615    f26aa69bb3f3  5 weeks ago  8.4 MB

Output of podman version:

# podman version
Client:       Podman Engine
Version:      4.2.0-dev
API Version:  4.2.0-dev
Go Version:   go1.18.3
Git Commit:   ee937c518e7efb9c47d21a4e1050b966ca02d005
Built:        Fri Jul 22 08:35:46 2022
OS/Arch:      linux/amd64

Output of podman info --debug:

# podman info --debug
host:
  arch: amd64
  buildahVersion: 1.27.0-dev
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 99.85
    systemPercent: 0.03
    userPercent: 0.12
  cpus: 12
  distribution:
    distribution: fedora
    variant: server
    version: "36"
  eventLogger: journald
  hostname: fedora36
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.18.11-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 4137209856
  memTotal: 8326590464
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.4.5-1.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.5
      commit: c381048530aa750495cf502ddb7181f2ded5b400
      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
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 8325689344
  swapTotal: 8325689344
  uptime: 15h 56m 26.00s (Approximately 0.62 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /usr/share/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
  graphRootAllocated: 106285760512
  graphRootUsed: 18810851328
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 1
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.2.0-dev
  Built: 1658446546
  BuiltTime: Fri Jul 22 08:35:46 2022
  GitCommit: ee937c518e7efb9c47d21a4e1050b966ca02d005
  GoVersion: go1.18.3
  Os: linux
  OsArch: linux/amd64
  Version: 4.2.0-dev

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

Yes

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

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 22, 2022
@vrothberg
Copy link
Member

Thanks for the report and the PR (#15034), @sstosh !

sstosh added a commit to sstosh/podman that referenced this issue Jul 27, 2022
This bug is reproduced when we execute the following command:

1. podman manifest add <manifest list> <images exist on local storage>
2. podman manifest push --rm <manifest list> dir:<directory>

If pushing succeeds, it is expected to remove only a manifest list.
However, manifest list remains on local storage and images are removed.

This commit fixes `podman manifest push --rm` to remove only a manifest list.

And, supports `manifest push --rm option` in remote environment,
like host environment.

Fixes: containers#15033

Signed-off-by: Toshiki Sonoda <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 10, 2022
This bug is reproduced when we execute the following command:

1. podman manifest add <manifest list> <images exist on local storage>
2. podman manifest push --rm <manifest list> dir:<directory>

If pushing succeeds, it is expected to remove only a manifest list.
However, manifest list remains on local storage and images are removed.

This commit fixes `podman manifest push --rm` to remove only a manifest list.

And, supports `manifest push --rm option` in remote environment,
like host environment.

Fixes: containers#15033

Signed-off-by: Toshiki Sonoda <[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 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 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.

2 participants