Bug 2086972 - oc-mirror does not error invalid metadata is passed to the describe command
Summary: oc-mirror does not error invalid metadata is passed to the describe command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.11.0
Assignee: Alex
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-17 00:47 UTC by Jennifer Power
Modified: 2022-08-10 11:12 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:12:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 463 0 None open Bug 2086972: test: adds test cases to image builder and describe pkgs and add go sec fixes 2022-05-17 14:52:49 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:12:45 UTC

Description Jennifer Power 2022-05-17 00:47:29 UTC
Description of problem:

oc-mirror does not error when invalid metadata is passed to the describe command


Version-Release number of selected component (if applicable):
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.2.0-alpha.1-36-g7bde4c7", GitCommit:"7bde4c7b", GitTreeState:"clean", BuildDate:"2022-05-17T00:40:46Z", GoVersion:"go1.17.1", Compiler:"gc", Platform:"linux/amd64"}


How reproducible:
100%

Steps to Reproduce:
1. Generate an imageset with the latest 4.10 release of oc-mirror. Any configuration
2. Compile the this version of oc-mirror for 4.11 release.
3. Run oc-mirror
oc-mirror describe out/mirror_seq1_000000.tar

Actual results:
{
 "kind": "Metadata",
 "apiVersion": "mirror.openshift.io/v1alpha2",
 "uid": "00000000-0000-0000-0000-000000000000",
 "singleUse": false,
 "pastMirror": {
  "timestamp": 0,
  "sequence": 0,
  "mirror": {
   "platform": {},
   "helm": {}
  }
 }
}


Expected results:

The API version is not valid so error expected:
error: error retrieving metadata from "out/mirror_seq1_000000.tar": config GVK not recognized: mirror.openshift.io/v1alpha1, Kind=Metadata


Additional info:

Comment 2 zhou ying 2022-05-31 13:14:26 UTC
waiting for newer version

Comment 4 zhou ying 2022-06-06 05:17:09 UTC
can't reproduce the issue now :

oc-mirror describe mirror_seq1_000000.tar 
error: error retrieving metadata from "mirror_seq1_000000.tar": config GVK not recognized: mirror.openshift.io/v1alpha1, Kind=Metadata

 oc-mirror version 
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202206030929.p0.gb22233e.assembly.stream-b22233e", GitCommit:"b22233e611ab4692748ffc992a235abd9c231ecf", GitTreeState:"clean", BuildDate:"2022-06-03T10:12:00Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}

Comment 6 errata-xmlrpc 2022-08-10 11:12:29 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.