Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.6.0-dev
v0.6.1
10 changes: 7 additions & 3 deletions internal/ocm-cli/component_getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down