Skip to content

Commit

Permalink
🐛 Retrieval of dependencies in analysis, is for all deps (#536)
Browse files Browse the repository at this point in the history
When getting dependencies during analysis, always retrieve all
dependencies

Signed-off-by: Shawn Hurley <[email protected]>
  • Loading branch information
shawn-hurley authored Mar 13, 2024
1 parent e0b3756 commit ddd55af
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cmd/analyzer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func AnalysisCmd() *cobra.Command {
if depOutputFile != "" {
depCtx, depSpan = tracing.StartNewSpan(ctx, "dep")
wg.Add(1)
go DependencyOutput(depCtx, providers, log, errLog, depOutputFile, dependencyLabelSelector, wg)
go DependencyOutput(depCtx, providers, log, errLog, depOutputFile, wg)
}

// This will already wait
Expand Down Expand Up @@ -420,7 +420,7 @@ func createOpenAPISchema(providers map[string]provider.InternalProviderClient, l
return sc
}

func DependencyOutput(ctx context.Context, providers map[string]provider.InternalProviderClient, log logr.Logger, errLog logr.Logger, depOutputFile string, labelSelector *labels.LabelSelector[*konveyor.Dep], wg *sync.WaitGroup) {
func DependencyOutput(ctx context.Context, providers map[string]provider.InternalProviderClient, log logr.Logger, errLog logr.Logger, depOutputFile string, wg *sync.WaitGroup) {
defer wg.Done()
var depsFlat []konveyor.DepsFlatItem
var depsTree []konveyor.DepsTreeItem
Expand Down Expand Up @@ -451,13 +451,6 @@ func DependencyOutput(ctx context.Context, providers map[string]provider.Interna
}
for u, ds := range deps {
newDeps := ds
if labelSelector != nil {
newDeps, err = labelSelector.MatchList(ds)
if err != nil {
errLog.Error(err, "error matching label selector on deps")
continue
}
}
depsFlat = append(depsFlat, konveyor.DepsFlatItem{
Provider: name,
FileURI: string(u),
Expand Down

0 comments on commit ddd55af

Please sign in to comment.