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

oc-mirror panic when running with REGISTRY_AUTH_PREFERENCE=podman env

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Critical Critical
    • None
    • 4.17
    • oc-mirror
    • Critical
    • None
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      oc-mirror panic when set REGISTRY_AUTH_PREFERENCE=podman env

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

      ./oc-mirror version 
      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.17.0-202408211406.p0.g7bb92a7.assembly.stream.el9-7bb92a7", GitCommit:"7bb92a7df45294577d0021d8b41869a912b6ac84", GitTreeState:"clean", BuildDate:"2024-08-22T00:06:03Z", GoVersion:"go1.22.5 (Red Hat 1.22.5-1.el9) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

      How reproducible:

      100%

      Steps to Reproduce:

      1) Set env : `export REGISTRY_AUTH_PREFERENCE=podman`;
      2) Run oc-mirror command with isc: 
      cat config.yaml 
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v2alpha1
      mirror:
        operators:
        - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
          packages:
            - name: cincinnati-operator
              channels:
                - name: v1
                  minVersion: 5.0.3
      
      `./oc-mirror -c config.yaml docker://localhost:5000 --v2 --workspace file://testoo`

      Actual results:

      2) oc-mirror command panic with error : 
      ./oc-mirror -c config.yaml docker://localhost:5000 --v2 --workspace file://testoo
       
      2024/08/22 06:36:13  [WARN]   : ⚠️  --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready.
      2024/08/22 06:36:13  [INFO]   : 👋 Hello, welcome to oc-mirror
      2024/08/22 06:36:13  [INFO]   : ⚙️  setting up the environment for you...
      2024/08/22 06:36:13  [INFO]   : 🔀 workflow mode: mirrorToMirror 
      2024/08/22 06:36:13  [ERROR]  : parsing config error parsing local storage configuration : parsing environment variable REGISTRY_AUTH_PREFERENCE: yaml: unmarshal errors:
        line 1: cannot unmarshal !!str `podman` into configuration.Parameters
      panic: StorageDriver not registered: 
       
      goroutine 1 [running]:
      github.com/distribution/distribution/v3/registry/handlers.NewApp({0x563b718, 0x76f2280}, 0xc000b82e08)
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/distribution/distribution/v3/registry/handlers/app.go:126 +0x2374
      github.com/distribution/distribution/v3/registry.NewRegistry({0x563b718?, 0x76f2280?}, 0xc000b82e08)
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/distribution/distribution/v3/registry/registry.go:141 +0x56
      github.com/openshift/oc-mirror/v2/internal/pkg/cli.(*ExecutorSchema).setupLocalStorage(0xc000332d88)
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/openshift/oc-mirror/v2/internal/pkg/cli/executor.go:570 +0x3c6
      github.com/openshift/oc-mirror/v2/internal/pkg/cli.NewMirrorCmd.func1(0xc000547208, {0xc000a8c900, 0x1, 0x6})
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/openshift/oc-mirror/v2/internal/pkg/cli/executor.go:200 +0x25f
      github.com/spf13/cobra.(*Command).execute(0xc000547208, {0xc000052240, 0x6, 0x6})
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:987 +0xab1
      github.com/spf13/cobra.(*Command).ExecuteC(0xc000547208)
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:1115 +0x3ff
      github.com/spf13/cobra.(*Command).Execute(0x74c6558?)
      /go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:1039 +0x13
      main.main()
      /go/src/github.com/openshift/oc-mirror/cmd/oc-mirror/main.go:10 +0x18
       

      Expected results:

      No error

       

              luzuccar@redhat.com Luigi Mario Zuccarelli
              yinzhou@redhat.com ying zhou
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: