Bug 2098172 - oc-mirror does not validatethe registry in the storage config
Summary: oc-mirror does not validatethe registry in the storage config
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-17 13:39 UTC by Jennifer Power
Modified: 2022-08-10 11:18 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:18:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 489 0 None open Bug 2098172: Adds validation for inaccessible registry endpoints 2022-06-17 13:41:04 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:18:38 UTC

Description Jennifer Power 2022-06-17 13:39:04 UTC
Description of problem:
oc-mirror does not validate that the registry in the storage config
is accessible.


Version-Release number of selected component (if applicable):
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202206101306.p0.g01d488f.assembly.stream-01d488f", GitCommit:"01d488f6b1cbab2a199f41ee03d143658605184f", GitTreeState:"clean", BuildDate:"2022-06-10T16:58:35Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}


How reproducible:
100%


Steps to Reproduce:
1. Generate a config
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  registry:
    imageURL: fakeregistry.com/example/oc-mirror
    skipTLS: true
mirror:
  helm:
    repositories:
      - name: podinfo
        url: https://stefanprodan.github.io/podinfo
        charts:
          - name: podinfo
            version: 5.0.0
2. oc-mirror --config imageset-config.yaml file://

Actual results:

oc-mirror mirrors the images and fails at the end when trying to publish the metadata.


Expected results:

oc-mirror fails because this registry is invalid


Additional info:
https://github.com/openshift/oc-mirror/issues/249

Comment 3 zhou ying 2022-06-22 02:39:49 UTC
can't reproduce the issue now:

oc-mirror version 
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202205131159.p0.g7bde4c7.assembly.stream-7bde4c7", GitCommit:"7bde4c7bde6b829a34592b2d12115fb38b15576f", GitTreeState:"clean", BuildDate:"2022-05-13T12:59:14Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}


[root@localhost ocmirrortest]# oc-mirror --config regsitryve.yaml file://
Creating directory: oc-mirror-workspace/src/publish
Creating directory: oc-mirror-workspace/src/v2
Creating directory: oc-mirror-workspace/src/charts
error: Get "https://fakeregistry.com/v2/": dial tcp: lookup fakeregistry.com: no such host; Get "http://fakeregistry.com/v2/": dial tcp: lookup fakeregistry.com: no such host

Comment 5 errata-xmlrpc 2022-08-10 11:18:27 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.