Skip to content

Commit

Permalink
Fix outputDeps and situation when missing for just some apps
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Aufart <[email protected]>
  • Loading branch information
aufi committed Nov 13, 2024
1 parent e793735 commit 007651d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/analyze-bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,6 @@ func (a *analyzeCommand) buildStaticReportFile(ctx context.Context, staticReport
outputAnalyses = nil
outputDeps = nil
outputFiles, err := filepath.Glob(filepath.Join(a.output, "output.yaml.*"))
// optional
outputDeps, _ := filepath.Glob(filepath.Join(a.output, "dependencies.yaml.*"))
if err != nil {
return err
}
Expand All @@ -555,7 +553,12 @@ func (a *analyzeCommand) buildStaticReportFile(ctx context.Context, staticReport
applicationName := strings.SplitN(outputName, "output.yaml.", 2)[1]
applicationNames = append(applicationNames, applicationName)
outputAnalyses = append(outputAnalyses, outputFiles[i])
outputDeps = append(outputDeps, fmt.Sprintf("%s.%s", DepsOutputMountPath, applicationName))
deps := fmt.Sprintf("%s.%s", filepath.Join(a.output, "dependencies.yaml"), applicationName)
// If deps for given application are missing, empty the deps path allowing skip it in static-report
if _, err := os.Stat(deps); errors.Is(err, os.ErrNotExist) {
deps = ""
}
outputDeps = append(outputDeps, deps)
}

}
Expand Down

0 comments on commit 007651d

Please sign in to comment.