Bug 2088130 - oc-mirror init does not allow for automated testing
Summary: oc-mirror init does not allow for automated testing
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-18 18:53 UTC by Jennifer Power
Modified: 2022-08-10 11:13 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:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 470 0 None open Bug 2088130: fix(init): bug/init cmd force prompting 2022-05-18 19:46:28 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:13:19 UTC

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


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