Bug 2094866 - oc-mirror does not always delete all manifests associated with an image during pruning
Summary: oc-mirror does not always delete all manifests associated with an image durin...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.11.0
Assignee: Alex
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-08 13:47 UTC by Jennifer Power
Modified: 2022-08-10 11:17 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:17:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 486 0 None open Bug 2094866: fix(pruning): handles child manifest deletion and tagged references 2022-06-08 20:17:50 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:17:22 UTC

Description Jennifer Power 2022-06-08 13:47:39 UTC
Description of problem:

oc-mirror does not always delete all manifests associated with an image during pruning

Version-Release number of selected component (if applicable):
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.2.0-alpha.1-51-g76ebe60", GitCommit:"76ebe609", GitTreeState:"clean", BuildDate:"2022-06-08T13:29:14Z", GoVersion:"go1.17.1", Compiler:"gc", Platform:"linux/amd64"}


How reproducible:
100% with a certain manifest type

Steps to Reproduce:
1. Generate a configuration
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: metadata
mirror:
  additionalImages:
  - name: registry.redhat.io/ubi7/go-toolset:1.13.4
2. Mirror to the registry
oc-mirror --config imageset-config.yaml docker://localhost:5000
3. Update the tag in the configuration
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: metadata
mirror:
  additionalImages:
  - name: registry.redhat.io/ubi7/go-toolset:1.14
4. 2. Mirror to the registry
oc-mirror --config imageset-config.yaml docker://localhost:5000

Actual results:
registry.redhat.io/ubi7/go-toolset:1.13.4 has one index manifest and three child manifest. oc-mirror only attempts to delete the index manifest.

Expected results:

oc-mirror deletes any unreferenced index or child manifests. In this case, four manifests should be deleted since there are no shared manifests between these two tagged images.

Additional info:
May be related to https://bugzilla.redhat.com/show_bug.cgi?id=2093980

Comment 2 zhou ying 2022-06-10 03:55:32 UTC
can't reproduce the issue now:


oc-mirror --config configset.yaml docker://localhost:5000/testprune --dest-use-http
Checking push permissions for localhost:5000
Found: oc-mirror-workspace/src/publish
Found: oc-mirror-workspace/src/v2
Found: oc-mirror-workspace/src/charts
Found: oc-mirror-workspace/src/release-signatures
No metadata detected, creating new workspace
localhost:5000/
  testprune/ubi7/go-toolset
    blobs:
      registry.redhat.io/ubi7/go-toolset sha256:1aaac053ab57c5025642bd358519f6a135e5a127930706e9594602f41ee6a9f8 1.702KiB
      registry.redhat.io/ubi7/go-toolset sha256:e7021e0589e97471d99c4265b7c8e64da328e48f116b5f260353b2e0a2adb373 1.703KiB
      registry.redhat.io/ubi7/go-toolset sha256:2f6a48a36dfe338b398dfca711ab0fe04e8076726f45e80670958ea648537694 1.715KiB
      registry.redhat.io/ubi7/go-toolset sha256:36cd27cc3d639652c8e088fa0678ca6d97b8c0dabb382921494883cdf0981b34 6.055KiB
      registry.redhat.io/ubi7/go-toolset sha256:154cb1c3faccaa999c4356616b5600b8df2168a4188675d9b05fdacc77d489d8 6.058KiB
      registry.redhat.io/ubi7/go-toolset sha256:229f8db1f759fd693188901a6bb7830a964273b19a578a3e1aeb700283fa51e3 6.069KiB
      registry.redhat.io/ubi7/go-toolset sha256:9e7a6dc796f0a75c560158a9f9e30fb8b5a90cb53edce9ffbdf5778406e4de39 6.875MiB
      registry.redhat.io/ubi7/go-toolset sha256:ae2fbfe7db8730550723984bbfcb983331e4ff33fe60758e1a039a0f2b493431 7.355MiB
      registry.redhat.io/ubi7/go-toolset sha256:5335ef1ff64e6af344595135e6a2672399cfbce2e8a64c6d28fdeb305f1e3fd1 7.675MiB
      registry.redhat.io/ubi7/go-toolset sha256:fc5b206e9329a1674dd9e8efbee45c9be28d0d0dcbabba3c6bb67a2f22cfcf2a 72.71MiB
      registry.redhat.io/ubi7/go-toolset sha256:73b0386f3ab7bcba25dbde6853d5f23fc3f4258be0abefb8ca06a1c35674001d 73.04MiB
      registry.redhat.io/ubi7/go-toolset sha256:7da67a5b6b815a5368554a138f6f5f1e3357be75679def8d26d5d6b6675a3040 76.69MiB
      registry.redhat.io/ubi7/go-toolset sha256:d0ca357f79a007fc8b49d30f5f4fde437984dc041ab151d4d3d94892a4f108cc 79.48MiB
      registry.redhat.io/ubi7/go-toolset sha256:f659c5c779ac4373302bfe3dc7d713c59cf9ec9f179a71e9b26336a51043fad2 83.99MiB
      registry.redhat.io/ubi7/go-toolset sha256:d2ab4fa3df7247d05c274b0cdbc04db37774794700756787e1b6aa9ade107ab9 87.85MiB
      registry.redhat.io/ubi7/go-toolset sha256:3788c8273bbca895b3d1ad1a6de200856bb75e748b34cdaa8d15063d2c5cd82d 113.8MiB
      registry.redhat.io/ubi7/go-toolset sha256:661e5327e27356b3f1da044ada98c8590391feaa90c99eaa7a003097cb8c4979 120.3MiB
      registry.redhat.io/ubi7/go-toolset sha256:a3eb7a89dbd0e443223b8c80b86dc9ad4d1949c92ab96c87e2861170431ff8c7 126MiB
    manifests:
      sha256:1e4c80b04d17331fe89fa1f119bbddc7ec562916bb57215c9f14230c826bfcf4
      sha256:29ccdd60e9b08fd3a5b5418cbd228a1a472de6ac65f46a0c1833d51a6470404b
      sha256:64fced5004d1d0a7d2028abc0963b2afdfaf5de45fd5b3faa2965164539fbaff
      sha256:73cf75dd3b3c5ba2c7a3bf5725bd5f1c831afdc8cb6df11ef0617027ca35c517
      sha256:73cf75dd3b3c5ba2c7a3bf5725bd5f1c831afdc8cb6df11ef0617027ca35c517 -> 1.13.4
  stats: shared=0 unique=18 size=855.9MiB ratio=1.00

phase 0:
  localhost:5000 testprune/ubi7/go-toolset blobs=18 mounts=0 manifests=5 shared=0

info: Planning completed in 4.46s
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:5335ef1ff64e6af344595135e6a2672399cfbce2e8a64c6d28fdeb305f1e3fd1 7.675MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:ae2fbfe7db8730550723984bbfcb983331e4ff33fe60758e1a039a0f2b493431 7.355MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:fc5b206e9329a1674dd9e8efbee45c9be28d0d0dcbabba3c6bb67a2f22cfcf2a 72.71MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:7da67a5b6b815a5368554a138f6f5f1e3357be75679def8d26d5d6b6675a3040 76.69MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:661e5327e27356b3f1da044ada98c8590391feaa90c99eaa7a003097cb8c4979 120.3MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:d2ab4fa3df7247d05c274b0cdbc04db37774794700756787e1b6aa9ade107ab9 87.85MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:9e7a6dc796f0a75c560158a9f9e30fb8b5a90cb53edce9ffbdf5778406e4de39 6.875MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:f659c5c779ac4373302bfe3dc7d713c59cf9ec9f179a71e9b26336a51043fad2 83.99MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:a3eb7a89dbd0e443223b8c80b86dc9ad4d1949c92ab96c87e2861170431ff8c7 126MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:3788c8273bbca895b3d1ad1a6de200856bb75e748b34cdaa8d15063d2c5cd82d 113.8MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:73b0386f3ab7bcba25dbde6853d5f23fc3f4258be0abefb8ca06a1c35674001d 73.04MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:d0ca357f79a007fc8b49d30f5f4fde437984dc041ab151d4d3d94892a4f108cc 79.48MiB
sha256:1e4c80b04d17331fe89fa1f119bbddc7ec562916bb57215c9f14230c826bfcf4 localhost:5000/testprune/ubi7/go-toolset
sha256:29ccdd60e9b08fd3a5b5418cbd228a1a472de6ac65f46a0c1833d51a6470404b localhost:5000/testprune/ubi7/go-toolset
sha256:64fced5004d1d0a7d2028abc0963b2afdfaf5de45fd5b3faa2965164539fbaff localhost:5000/testprune/ubi7/go-toolset
sha256:73cf75dd3b3c5ba2c7a3bf5725bd5f1c831afdc8cb6df11ef0617027ca35c517 localhost:5000/testprune/ubi7/go-toolset:1.13.4
info: Mirroring completed in 52.62s (17.05MB/s)
Writing image mapping to oc-mirror-workspace/results-1654832521/mapping.txt
Writing ICSP manifests to oc-mirror-workspace/results-1654832521



oc-mirror --config configset.yaml docker://localhost:5000/testprune --dest-use-http
Checking push permissions for localhost:5000
Creating directory: oc-mirror-workspace/src/publish
Creating directory: oc-mirror-workspace/src/v2
Creating directory: oc-mirror-workspace/src/charts
Creating directory: oc-mirror-workspace/src/release-signatures
localhost:5000/
  testprune/ubi7/go-toolset
    blobs:
      registry.redhat.io/ubi7/go-toolset sha256:74bb02b6a36633f8fdb8f1a639866934c6b0b4e177ff08f0910bb0de33d62e09 1.776KiB
      registry.redhat.io/ubi7/go-toolset sha256:ecf034979930530410786a59b990e44ccf4f5927a299f5b0f1e987c5b6b28db1 1.794KiB
      registry.redhat.io/ubi7/go-toolset sha256:6e2436143fef39df06fd0ba677badfea7dcd296b5d1ddfc147ec4c29cefeb769 1.804KiB
      registry.redhat.io/ubi7/go-toolset sha256:5fc224eeeac349fc31d2c0a7cb2a3a04c330864acc97d3c92e2ec6562b32eb27 6.054KiB
      registry.redhat.io/ubi7/go-toolset sha256:fe6be3775dfc3a5fae5f22f044566e0421b41dfa7f5483f63c986cee9866e293 6.06KiB
      registry.redhat.io/ubi7/go-toolset sha256:f4cf94f71fe258ab3dd233319b4f905a867ceda13e6f7e7325da16535ad4eaa5 6.073KiB
      registry.redhat.io/ubi7/go-toolset sha256:027c952e3ecf302f97f300dd67ccb319e7d26d0b8e3aba859b748f48b69e63ef 6.891MiB
      registry.redhat.io/ubi7/go-toolset sha256:d6f65d3743d96cf87a593ed437d94397e7f64b59469c89ff43fdfdb2ffa91a22 7.386MiB
      registry.redhat.io/ubi7/go-toolset sha256:7d416f5cca37b287f09e2c628b843124769962dc2d7dc0e8c54cc046d5d4c9f8 7.73MiB
      registry.redhat.io/ubi7/go-toolset sha256:d80ffbe76b5f29ddea85672e120fa0a9be012874557f8e942a0ee16b7b6c93d1 72.88MiB
      registry.redhat.io/ubi7/go-toolset sha256:c8b774b421ae92b3d1f486f804ec219c3bb28426b28c49362223af7e0fbc8c09 73.28MiB
      registry.redhat.io/ubi7/go-toolset sha256:8245d91ab84b87528df39429c04e7e4b9f2f0358832140bcfd4dda41c0c34dab 76.86MiB
      registry.redhat.io/ubi7/go-toolset sha256:71f46f434f4c1227376ad974372b6c5060e1edb96dd43776e82152010d13b0d0 79.55MiB
      registry.redhat.io/ubi7/go-toolset sha256:6aeb165eb1de90d7a260e020c90b680506d3f0b7d01169f3981eb63ef8c11c0a 83.99MiB
      registry.redhat.io/ubi7/go-toolset sha256:b6562b608bfe0dfe66c6a0038152ab2d9002effff25044ebc70d4102a7d3cac5 87.79MiB
      registry.redhat.io/ubi7/go-toolset sha256:882100db3e49359ba91d5f75377985f2d016d0f652bce85845dcbc280e894215 119MiB
      registry.redhat.io/ubi7/go-toolset sha256:52439662518dc0c973d08294ad33e3fdbb83ece817ba714a974078818f6e7d8a 125.3MiB
      registry.redhat.io/ubi7/go-toolset sha256:ab122433ccfb4bd896c463c7c8dd2390ce1a915bc807e416bb24f4ceb09e3c43 131.4MiB
    manifests:
      sha256:16ae341b9458c9f0819c06d278706d56592102194238d0a8dd062688b0c64235
      sha256:4d923f851d3e1fe2f067b8f951a8ab80d9b089fa90947e4f17ef8aae3fde1d95
      sha256:f23b8837b88487098bab5ed15fb0a18857b4d8052a4261e0d0bea0c66d7b28e7
      sha256:f9b3b2fd3be8d2e387ced327821985fc9abb50f35b2b1c8461cac9fe73dd331c
      sha256:f23b8837b88487098bab5ed15fb0a18857b4d8052a4261e0d0bea0c66d7b28e7 -> 1.14
  stats: shared=0 unique=18 size=872MiB ratio=1.00

phase 0:
  localhost:5000 testprune/ubi7/go-toolset blobs=18 mounts=0 manifests=5 shared=0

info: Planning completed in 11.76s
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:882100db3e49359ba91d5f75377985f2d016d0f652bce85845dcbc280e894215 119MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:027c952e3ecf302f97f300dd67ccb319e7d26d0b8e3aba859b748f48b69e63ef 6.891MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:6aeb165eb1de90d7a260e020c90b680506d3f0b7d01169f3981eb63ef8c11c0a 83.99MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:ab122433ccfb4bd896c463c7c8dd2390ce1a915bc807e416bb24f4ceb09e3c43 131.4MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:52439662518dc0c973d08294ad33e3fdbb83ece817ba714a974078818f6e7d8a 125.3MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:71f46f434f4c1227376ad974372b6c5060e1edb96dd43776e82152010d13b0d0 79.55MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:7d416f5cca37b287f09e2c628b843124769962dc2d7dc0e8c54cc046d5d4c9f8 7.73MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:8245d91ab84b87528df39429c04e7e4b9f2f0358832140bcfd4dda41c0c34dab 76.86MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:d6f65d3743d96cf87a593ed437d94397e7f64b59469c89ff43fdfdb2ffa91a22 7.386MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:b6562b608bfe0dfe66c6a0038152ab2d9002effff25044ebc70d4102a7d3cac5 87.79MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:c8b774b421ae92b3d1f486f804ec219c3bb28426b28c49362223af7e0fbc8c09 73.28MiB
uploading: localhost:5000/testprune/ubi7/go-toolset sha256:d80ffbe76b5f29ddea85672e120fa0a9be012874557f8e942a0ee16b7b6c93d1 72.88MiB
sha256:f9b3b2fd3be8d2e387ced327821985fc9abb50f35b2b1c8461cac9fe73dd331c localhost:5000/testprune/ubi7/go-toolset
sha256:16ae341b9458c9f0819c06d278706d56592102194238d0a8dd062688b0c64235 localhost:5000/testprune/ubi7/go-toolset
sha256:4d923f851d3e1fe2f067b8f951a8ab80d9b089fa90947e4f17ef8aae3fde1d95 localhost:5000/testprune/ubi7/go-toolset
sha256:f23b8837b88487098bab5ed15fb0a18857b4d8052a4261e0d0bea0c66d7b28e7 localhost:5000/testprune/ubi7/go-toolset:1.14
info: Mirroring completed in 47.43s (19.28MB/s)
Pruning 4 manifest(s) from repository testprune/ubi7/go-toolset
Deleting manifest sha256:1e4c80b04d17331fe89fa1f119bbddc7ec562916bb57215c9f14230c826bfcf4 from repo testprune/ubi7/go-toolset
Deleting manifest sha256:29ccdd60e9b08fd3a5b5418cbd228a1a472de6ac65f46a0c1833d51a6470404b from repo testprune/ubi7/go-toolset
Deleting manifest sha256:64fced5004d1d0a7d2028abc0963b2afdfaf5de45fd5b3faa2965164539fbaff from repo testprune/ubi7/go-toolset
Deleting manifest sha256:73cf75dd3b3c5ba2c7a3bf5725bd5f1c831afdc8cb6df11ef0617027ca35c517 from repo testprune/ubi7/go-toolset
Writing image mapping to oc-mirror-workspace/results-1654832751/mapping.txt
Writing ICSP manifests to oc-mirror-workspace/results-1654832751

Comment 4 errata-xmlrpc 2022-08-10 11:17:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069


Note You need to log in before you can comment on or make changes to this bug.