Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-23309

oc-mirror should failed but not panic when falied to band port

XMLWordPrintable

    • Important
    • None
    • CLID Sprint 246
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • N/A
    • Release Note Not Required
    • Done
    • Customer Facing

      Description of problem:

      When use oc-mirror try to band port failed will panic 

       

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

      ./oc-mirror version 
      Logging to .oc-mirror.log
      WARNING: This version information is deprecated and will be replaced with the output from --short. Use --output=yaml|json to get the full version.
      Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.15.0-202311101707.p0.g1c8f538.assembly.stream-1c8f538", GitCommit:"1c8f538897c88011c51ab53ea5073547521f0676", GitTreeState:"clean", BuildDate:"2023-11-10T18:49:00Z", GoVersion:"go1.20.10 X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

      How reproducible:

      always

      Steps to Reproduce:

      run command : oc-mirror --from file://out docker://localhost:5000/ocptest --v2 --config config.yaml --dest-tls-verify=false   

      Actual results: 
      oc-mirror --from file://out docker://localhost:5000/ocptest --v2 --config config.yaml --dest-tls-verify=false 
      --v2 flag identified, flow redirected to the oc-mirror v2 version. PLEASE DO NOT USE that. V2 is still under development and it is not ready to be used. 
      2023/11/15 13:04:47  [INFO]   : mode diskToMirror 
      2023/11/15 13:04:47  [INFO]   : local storage registry will log to /app1/1106/logs/registry.log
      2023/11/15 13:04:47  [INFO]   : starting local storage on :5000
      panic: listen tcp :5000: bind: address already in use
       
      goroutine 67 [running]:
      github.com/openshift/oc-mirror/v2/pkg/cli.panicOnRegistryError(0x0?)
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/openshift/oc-mirror/v2/pkg/cli/executor.go:298 +0x4e
      created by github.com/openshift/oc-mirror/v2/pkg/cli.(*ExecutorSchema).PrepareStorageAndLogs
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/openshift/oc-mirror/v2/pkg/cli/executor.go:286 +0x945

       

      Expected results:

      Should exit with error but not panic

       

              skhoury@redhat.com Sherine Khoury
              yinzhou@redhat.com ying zhou
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: