Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"oc-mirror version" command complaints about read-only file system #659

Closed
benoitschipper opened this issue Jun 28, 2023 · 0 comments · Fixed by #660
Closed

"oc-mirror version" command complaints about read-only file system #659

benoitschipper opened this issue Jun 28, 2023 · 0 comments · Fixed by #660

Comments

@benoitschipper
Copy link
Contributor

benoitschipper commented Jun 28, 2023

Version

$ oc-mirror version
client Version: version.Info{Major:"", Minor:"", GitVersion:"4.13.0-202306090756.p0.g31f847a.assembly.stream-31f847a", GitCommit:"31f847af4c69f297a328b35bb4a1ac329ccc198e", GitTreeState:"clean", BuildDate:"2023-06-09T08:18:08Z", GoVersion:"go1.19.9", Compiler:"gc", Platform:"linux/amd64"}

What happened?

We use oc-mirror to pull in operators in an air-gapped environment. For this process, we use our default image puling pipeline (Tekton) to pull the oc-mirror image to in internal repo. This pipeline also tests the pulled image, for oc-mirror we use the oc-mirror version command. While running the test command, our pipeline runs into an error stating that the command can not be used on a Read-Only filesystem.

[test-image : test-image] goroutine 1 [running]:
[test-image : test-image] k8s.io/klog/v2/internal/dbg.Stacks(0x0)
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/internal/dbg/dbg.go:35 +0x89
[test-image : test-image] k8s.io/klog/v2.(*loggingT).output(0x6396920, 0x3, 0x0, 0xc000cec1c0, 0x1, {0x50008b4?, 0x7fc1ea69a108?}, 0x10?, 0x0)
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:935 +0x686
[test-image : test-image] k8s.io/klog/v2.(*loggingT).printDepth(0x6396920, 0xe?, 0x0, {0x0, 0x0}, 0xc000c9fb7f?, {0xc000cf6390?, 0x1, 0x1})
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:714 +0x1d3
[test-image : test-image] k8s.io/klog/v2.(*loggingT).print(...)
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:696
[test-image : test-image] k8s.io/klog/v2.Fatal(...)
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/k8s.io/klog/v2/klog.go:1595
[test-image : test-image] github.com/openshift/oc-mirror/pkg/cli.(*RootOptions).LogfilePreRun(0xc000cc49b0, 0x4?, {0x14abc3f?, 0x4?, 0x42b10d8?})
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/pkg/cli/options.go:46 +0x245
[test-image : test-image] github.com/spf13/cobra.(*Command).execute(0xc000be9800, {0x63d3ff8, 0x0, 0x0})
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:896 +0x711
[test-image : test-image] github.com/spf13/cobra.(*Command).ExecuteC(0xc000be9500)
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
[test-image : test-image] github.com/spf13/cobra.(*Command).Execute(...)
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:968
[test-image : test-image] main.main()
[test-image : test-image] 	/go/src/github.com/openshift/oc-mirror/cmd/oc-mirror/main.go:10 +0x1f

Image: openshift4/oc-mirror-plugin-rhel8
Attach the relevant portions of your .oc-mirror.log: N/A as read-only OS error occurred

What did you expect to happen?

I would not expect oc-mirror version to open files in the directory where the command is run. We currently got around this issue by changing the test command to "cd /tmp && oc-mirror version", but it would be cleaner if oc-mirror would be able to run form any folder without requiring permissions on the folder / files it is running from. We worked on a fix, which would report the file it is logging to, or report that logging is disabled.We will create a PR and link to this issue.

How to reproduce it (as minimally and precisely as possible)?

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: test-image
  namespace: example
spec:
  description: >-
    Obviously there would be parameters here but I hard coded the example
  steps:
    - image: registry.redhat.io/openshift4/oc-mirror-plugin-rhel8:latest
      name: test-image
      resources: {}
      script: |
        oc-mirror version

You can of course also simply create a pod with the image "registry.redhat.io/openshift4/oc-mirror-plugin-rhel8:latest" and launch it within OpenShift, use RSH or go to the browser and use the Terminal in order to try oc-mirror (outside of /tmp).

Anything else we need to know?

N/A

References

https://docs.openshift.com/container-platform/4.11/installing/disconnected_install/installing-mirroring-disconnected.html

PR created:
#660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant