Bug 2088130

Summary: oc-mirror init does not allow for automated testing
Product: OpenShift Container Platform Reporter: Jennifer Power <jpower>
Component: ocAssignee: Alex <aflom>
oc sub component: oc-mirror QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: jpower, vdinh
Version: 4.11   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:12:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jennifer Power 2022-05-18 18:53:18 UTC
Description of problem:

oc-mirror init prompts the user for input and makes automated testing more difficult

Version-Release number of selected component (if applicable):


How reproducible:
100%


Steps to Reproduce:
1. oc-mirror init
Enter custom registry image URL or blank for none.
Example: localhost:5000/test:latest

Actual results:

Requires some input (can just be a new line)

Expected results:

Requires no input by default


Additional info:

Comment 3 zhou ying 2022-05-23 01:40:20 UTC
waiting for latest version

Comment 4 zhou ying 2022-05-24 06:36:25 UTC
checked with latest version , the issue has fixed:

oc-mirror init -h
Output initial config template

Usage:
  oc-mirror init [flags]

Examples:
  # Get oc-mirror initial config template
  oc-mirror init
  
  # Get oc-mirror initial config template
  # with a registry storage backend
  oc-mirror init --registry localhost:5000/test:latest
  
  # Save oc-mirror initial config to a file
  oc-mirror init >imageset-config.yaml

Flags:
  -h, --help              help for init
      --output string     One of 'yaml' or 'json'.
      --registry string   Registry location for storage backend, if using.

Global Flags:
  -v, --verbose int   Number for the log level verbosity (valid 1-9, default is 0)
[root@localhost oc-mirror]# oc-mirror init 
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: ./
mirror:
  platform:
    channels:
    - name: stable-4.11
      type: ocp
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.11
    packages:
    - name: serverless-operator
      channels:
      - name: stable
  additionalImages:
  - name: registry.redhat.io/ubi8/ubi:latest
  helm: {}
[root@localhost oc-mirror]# oc-mirror init --registry localhost:5000/test:latest

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  registry:
    imageURL: localhost:5000/test:latest
    skipTLS: false
mirror:
  platform:
    channels:
    - name: stable-4.11
      type: ocp
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.11
    packages:
    - name: serverless-operator
      channels:
      - name: stable
  additionalImages:
  - name: registry.redhat.io/ubi8/ubi:latest
  helm: {}
[root@localhost oc-mirror]# 
[root@localhost oc-mirror]#  oc-mirror init >imageset-config.yaml
[root@localhost oc-mirror]# cat imageset-config.yaml 
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: ./
mirror:
  platform:
    channels:
    - name: stable-4.11
      type: ocp
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.11
    packages:
    - name: serverless-operator
      channels:
      - name: stable
  additionalImages:
  - name: registry.redhat.io/ubi8/ubi:latest
  helm: {}

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