Context
When having a component in different repositories and trying to do an ocm get cv call to them, the nested lookup logic is a bit inconvenient.
It will output errors even though the component is found after proper resolvers are configured.
This is this codepath here (
|
out.Errf(octx, "Warning: lookup nested component version %q:%s [%s]: %s\n", ref.ComponentName, vers, hist, err) |
):
nested, err := o.Repository.LookupComponentVersion(ref.ComponentName, vers)
if err != nil {
out.Errf(octx, "Warning: lookup nested component version %q:%s [%s]: %s\n", ref.ComponentName, vers, hist, err)
}
if nested == nil && lookup != nil {
nested, err = lookup.LookupComponentVersion(ref.ComponentName, vers)
if err != nil {
if !errors.IsErrNotFound(err) {
out.Errf(octx, "Warning: fallback lookup nested component version \"%s:%s\" [%s]: %s\n", ref.ComponentName, vers, hist, err)
} else {
err = nil
}
}
}
if err != nil {
continue
}
This is cumbersome and needs a bit of love to properly inform the user about what's going on.
Version
To Reproduce
Create two component versions in different repositories, parent and child. The parent should reference the child as a componentReference. Then configure your resolver like this so the child can be found in the repository you configured for the child:
type: generic.config.ocm.software/v1
configurations:
- type: ocm.config.ocm.software
resolvers:
- repository:
type: OCIRepository/v1
baseUrl: ghcr.io/repo2
subPath: subpath
prefix: github.com/open-component-model/child1
Then try to get the parent component with --recursive. The "Warning" should be displayed but the components should be found correctly.
Actual behavior
Expected behavior
Additional Comments
Context
When having a component in different repositories and trying to do an
ocm get cvcall to them, the nested lookup logic is a bit inconvenient.It will output errors even though the component is found after proper resolvers are configured.
This is this codepath here (
ocm/cmds/ocm/commands/ocmcmds/common/handlers/comphdlr/closure.go
Line 40 in 329ee5c
This is cumbersome and needs a bit of love to properly inform the user about what's going on.
Version
To Reproduce
Create two component versions in different repositories, parent and child. The parent should reference the child as a
componentReference. Then configure your resolver like this so the child can be found in the repository you configured for the child:Then try to get the parent component with
--recursive. The "Warning" should be displayed but the components should be found correctly.Actual behavior
Expected behavior
Additional Comments