diff --git a/VERSION b/VERSION index b0d08eb..45a9970 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.6.0-dev \ No newline at end of file +v0.6.1 \ No newline at end of file diff --git a/internal/ocm-cli/component_getter.go b/internal/ocm-cli/component_getter.go index 0e9df20..7739467 100644 --- a/internal/ocm-cli/component_getter.go +++ b/internal/ocm-cli/component_getter.go @@ -117,14 +117,18 @@ func (g *ComponentGetter) GetReferencedComponentVersionsRecursive(ctx context.Co // First, try to get the reference directly from the parent component version refs, err := g.GetReferencedComponentVersions(ctx, parentCV, refName) - if err == nil { + if err != nil { + return nil, fmt.Errorf("error getting referenced component versions for %s: %w", refName, err) + } + + if len(refs) > 0 { return refs, nil } // If not found, search recursively in all component references for _, componentRef := range parentCV.Component.ComponentReferences { subCVs, err := g.GetReferencedComponentVersions(ctx, parentCV, componentRef.Name) - if err != nil { + if err != nil || len(subCVs) == 0 { continue } for _, subCV := range subCVs { @@ -151,7 +155,7 @@ func (g *ComponentGetter) GetComponentVersionsForResourceRecursive(ctx context.C // If not found, search recursively in all component references for _, componentRef := range parentCV.Component.ComponentReferences { subCVs, err := g.GetReferencedComponentVersions(ctx, parentCV, componentRef.Name) - if err != nil { + if err != nil || len(subCVs) == 0 { continue } for _, subCV := range subCVs {