Description of problem:
when oc-mirror run in a directory without the write limit , will panic .
Version-Release number of selected component (if applicable):
4.12/4.13/4.14
How reproducible:
100%
Steps to Reproduce:
1. when run the oc-mirror in a directory without the write limit.
Actual results:
will panic :
oc-mirror init
goroutine 1 [running]:
k8s.io/klog/v2/internal/dbg.Stacks(0x0)
/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/internal/dbg/dbg.go:35 +0x89
k8s.io/klog/v2.(*loggingT).output(0x63926a0, 0x3, 0x0, 0xc0001f8a80, 0x1, {0x4ffddaf?, 0x7fa2559db5b8?}, 0x10?, 0x0)
/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:935 +0x686
k8s.io/klog/v2.(*loggingT).printDepth(0x63926a0, 0xe?, 0x0, {0x0, 0x0}, 0xc000dbfb7f?, {0xc000a35650?, 0x1, 0x1})
/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:714 +0x1d3
k8s.io/klog/v2.(*loggingT).print(...)
/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:696
k8s.io/klog/v2.Fatal(...)
/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:1595
github.com/openshift/oc-mirror/pkg/cli.(*RootOptions).LogfilePreRun(0xc00090fae0, 0x4?, {0x14aae7f?, 0x4?, 0x42aefc0?})
/go/src/github.com/openshift/oc-mirror/pkg/cli/options.go:46 +0x245
github.com/spf13/cobra.(*Command).execute(0xc000c06600, {0x63cfd78, 0x0, 0x0})
/go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:896 +0x711
github.com/spf13/cobra.(*Command).ExecuteC(0xc00093af00)
/go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:968
main.main()
/go/src/github.com/openshift/oc-mirror/cmd/oc-mirror/main.go:10 +0x1f.
Expected results:
Please give more clear information that we don't have priviledge to write for this directory .