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

targetCatalog with OCI source catalog results in error: unable to parse reference oci://<targetCatalog> #576

Closed
cdjohnson opened this issue Mar 9, 2023 · 2 comments · Fixed by #579

Comments

@cdjohnson
Copy link

cdjohnson commented Mar 9, 2023

Version

$ oc-mirror version
Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.2.0-alpha.1-92-g4696996", GitCommit:"4696996b", GitTreeState:"dirty", BuildDate:"2023-03-09T21:05:53Z", GoVersion:"go1.19.6", Compiler:"gc", Platform:"linux/amd64"}

What happened?

Built main today and am attempting to use an OCI feature set with the newly merged targetCatalog feature CFE-764. I added a debug.PrintStackTrace() to isolate the location of the problem. I suspect that one code path was simply missed, where the targetCatalog is being appended to the catalog instead of the publish destination.

The error is:
unable to parse reference oci://test1/catalog:test: lstat /test1: no such file or directory

command-line:
oc mirror -c /tmp/test1/isc.yaml --use-oci-feature=true --oci-insecure-signature-policy=true --dest-skip-tls=true docker://localhost:5000 --continue-on-error --dry-run --skip-cleanup --skip-missing

isc.yaml:

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
mirror:
  operators:
  - catalog: oci:///tmp/test1/catalog-oci
    targetCatalog: test1/catalog
    targetTag: test
    packages: []
    full: true
storageConfig:
  local:
    path: /tmp/test1/oc-mirror-workspace

Result:
THIS IS NOT A PANIC. This is a debug.printStackTrace(), so the line number points here:
https://github.com/openshift/oc-mirror/blob/main/pkg/image/image.go#L121

Checking push permissions for localhost:5000
Found: oc-mirror-workspace/src/publish
Found: oc-mirror-workspace/src/v2
Found: oc-mirror-workspace/src/charts
Found: oc-mirror-workspace/src/release-signatures
No metadata detected, creating new workspace
goroutine 1 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x19
github.com/openshift/oc-mirror/pkg/image.getManifest({0x45517d0, 0xc000198000}, {0xc0001b9830, 0x18})
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/image/image.go:122 +0x8e
github.com/openshift/oc-mirror/pkg/image.ParseReference({0xc0001b9830, 0x18})
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/image/image.go:108 +0x146
github.com/openshift/oc-mirror/pkg/cli/mirror.(*OperatorOptions).run(_, {_, _}, {{{0x3f0ecb8, 0x15}, {0xc000977980, 0x1c}}, {{{0x0, {...}, {...}}, ...}, ...}}, ...)
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/operator.go:117 +0x5f8
github.com/openshift/oc-mirror/pkg/cli/mirror.(*OperatorOptions).PlanFull(...)
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/operator.go:63
github.com/openshift/oc-mirror/pkg/cli/mirror.(*MirrorOptions).Create.func2({_, _}, {{{0x3f0ecb8, 0x15}, {0xc000977980, 0x1c}}, {{{0x0, {...}, {...}}, {0xc0009b96c0, ...}, ...}, ...}})
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/create.go:69 +0x130
github.com/openshift/oc-mirror/pkg/cli/mirror.(*MirrorOptions).run(_, {_, _}, _, {{{0x3eeceb3, 0x8}, {0xc000977a80, 0x1c}}, {{0x2d, 0x1a, ...}, ...}}, ...)
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/create.go:127 +0x3a5
github.com/openshift/oc-mirror/pkg/cli/mirror.(*MirrorOptions).Create(_, {_, _}, {{{0x3f0ecb8, 0x15}, {0xc000977980, 0x1c}}, {{{0x0, {...}, {...}}, ...}, ...}})
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/create.go:73 +0xa05
github.com/openshift/oc-mirror/pkg/cli/mirror.(*MirrorOptions).mirrorToMirrorWrapper(_, {_, _}, {{{0x3f0ecb8, 0x15}, {0xc000977980, 0x1c}}, {{{0x0, {...}, {...}}, ...}, ...}}, ...)
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/mirror.go:602 +0x170
github.com/openshift/oc-mirror/pkg/cli/mirror.(*MirrorOptions).mirrorImages(0xc000022700, {0x45517d0, 0xc000198000}, 0xc000a1fd50)
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/mirror.go:354 +0x2d8
github.com/openshift/oc-mirror/pkg/cli/mirror.(*MirrorOptions).Run(0x0?, 0x0?, {0x409fe30?, 0x363a69a?})
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/mirror.go:295 +0x85
github.com/openshift/oc-mirror/pkg/cli/mirror.NewMirrorCmd.func1(0xc000560a00?, {0xc0000e08c0?, 0xa?, 0xa?})
        /home/cdjohnson/bld/git-openshift/oc-mirror/pkg/cli/mirror/mirror.go:110 +0x8c
github.com/spf13/cobra.(*Command).execute(0xc000560a00, {0xc0001a6010, 0xa, 0xa})
        /home/cdjohnson/bld/git-openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc000560a00)
        /home/cdjohnson/bld/git-openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:974 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /home/cdjohnson/bld/git-openshift/oc-mirror/vendor/github.com/spf13/cobra/command.go:902
main.main()
        /home/cdjohnson/bld/git-openshift/oc-mirror/cmd/oc-mirror/main.go:10 +0x1f

unable to parse reference oci://test1/catalog:test: lstat /test1: no such file or directory
@sherine-k
Copy link
Contributor

Hi @cdjohnson
A PR is open for this #579 (comment) along with a Jira issue https://issues.redhat.com/browse/OCPBUGS-8216.
Would you agree to track this on the Jira project instead and close this one?
Thanks
Sherine

@cdjohnson
Copy link
Author

@sherine-k Yes, I have no problem with that.

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.

2 participants