Bug 1797203 - `oc image mirror` source digest mismatched to local mirror digest for OLM restricted network mirroring.
Summary: `oc image mirror` source digest mismatched to local mirror digest for OLM res...
Keywords:
Status: CLOSED DUPLICATE of bug 1800674
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.3.0
Hardware: x86_64
OS: All
high
high
Target Milestone: ---
: 4.4.0
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-01 11:59 UTC by Muhammad Aizuddin Zali
Modified: 2023-10-06 19:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-17 14:53:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Muhammad Aizuddin Zali 2020-02-01 11:59:42 UTC
Description of problem:
SHA digest mismatched between operator manifests and mirror image in the registry.

Version-Release number of selected component (if applicable):
# oc version
Client Version: openshift-clients-4.3.0-201910250623-88-g6a937dfe
Server Version: 4.3.0
Kubernetes Version: v1.16.2


How reproducible:
Everytime

Steps to Reproduce:
Followed this [1] official docs to setup mirror registry. And then once the cluster is up, ran this [2] to setup restricted OLM env.

1. 
 oc adm catalog build \
    --appregistry-endpoint https://quay.io/cnr \
    --appregistry-org redhat-operators \
    --to=registry.local.bytewise.my/openshift/redhat-operators:v1 --v 9


2.  Create manifest to only sync local-storage-operator.

oc adm catalog mirror     registry.local.bytewise.my:5000/openshift/redhat-operators:v1     registry.local.bytewise.my:5000/openshift4 --manifests-only

# cat redhat-operators-manifests/mapping.txt
registry.redhat.io/openshift4/ose-local-storage-operator@sha256:a0de56fca05d307ccd5edd5e38f4a4d299af33f54d3db7886fa9ace63d9d47fb=registry.local.bytewise.my:5000/openshift4/ose-local-storage-operator

3. Apply ImageContentPolicy and create catalogsource.

4. Mirror image from the manifest:
oc image mirror -f redhat-operators-manifests/mapping.txt

registry.local.bytewise.my:5000/
  openshift4/ose-local-storage-operator
    manifests:
      sha256:741ac89fd4b6f41af4a1efe3b0e046e9465e0cc03c9e18c3d55133636003a669
  stats: shared=0 unique=0 size=0B

phase 0:
  registry.local.bytewise.my:5000 openshift4/ose-local-storage-operator blobs=0 mounts=0 manifests=1 shared=0

info: Planning completed in 2.21s
sha256:741ac89fd4b6f41af4a1efe3b0e046e9465e0cc03c9e18c3d55133636003a669 registry.local.bytewise.my:5000/openshift4/ose-local-storage-operator
info: Mirroring completed in 10ms (0B/s)



5. Create Local Storage Operator subscription. The local-storage-operator  pod failed with ImagePullBackOff error.

Back-off pulling image "registry.redhat.io/openshift4/ose-local-storage-operator@sha256:a0de56fca05d307ccd5edd5e38f4a4d299af33f54d3db7886fa9ace63d9d47fb"


6. Check on the registry: 
Its being pulled by the digest mentioned in the operator manifests (sha256:a0de56fca05d307ccd5edd5e38f4a4d299af33f54d3db7886fa9ace63d9d47fb), but in mirrored registry its has changed to sha256:741ac89fd4b6f41af4a1efe3b0e046e9465e0cc03c9e18c3d55133636003a669.


time="2020-02-01T11:49:09.794941327Z" level=error msg="response completed with error" auth.user.name=admin err.code="manifest unknown" err.detail="unknown manifest name=openshift4/ose-local-storage-operator revision=sha256:a0de56fca05d307ccd5edd5e38f4a4d299af33f54d3db7886fa9ace63d9d47fb" err.message="manifest unknown" go.version=go1.11.2 http.request.host="registry.local.bytewise.my:5000" http.request.id=875531d7-456c-4bb7-aa10-168bc8a430ee http.request.method=GET http.request.remoteaddr="192.168.50.146:42636" http.request.uri="/v2/openshift4/ose-local-storage-operator/manifests/sha256:a0de56fca05d307ccd5edd5e38f4a4d299af33f54d3db7886fa9ace63d9d47fb" http.request.useragent="cri-o/1.16.2-6.dev.rhaos4.3.git9e3db66.el8 go/go1.12.12 os/linux arch/amd64" http.response.contenttype="application/json; charset=utf-8" http.response.duration=4.191153ms http.response.status=404 http.response.written=213 vars.name="openshift4/ose-local-storage-operator" vars.reference="sha256:a0de56fca05d307ccd5edd5e38f4a4d299af33f54d3db7886fa9ace63d9d47fb" 




[1]: https://docs.openshift.com/container-platform/4.3/installing/install_config/installing-restricted-networks-preparations.html

[2]: https://docs.openshift.com/container-platform/4.3/operators/olm-restricted-networks.html

Actual results:
SHA digest mismatched between operator manifests and mirror image in the registry. Hence pod pulling wrong image digest.

Expected results:
SHA digest should match operator manifest and image mirrored.

Additional info:

Comment 1 Sushil 2020-02-13 04:53:51 UTC
possible dupicate of https://bugzilla.redhat.com/show_bug.cgi?id=1800674

Do test/validate it first before marking this as a duplicate

--
Regards
Sushil Suresh

Comment 2 Evan Cordell 2020-02-17 14:53:33 UTC

*** This bug has been marked as a duplicate of bug 1800674 ***


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