Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Handle missing containerless-deps #349

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion cmd/analyze-bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ func (b *analyzeBinCommand) fetchLabels(ctx context.Context, listSources, listTa

func (b *analyzeBinCommand) walkRuleFilesForLabels(label string) ([]string, error) {
labelsSlice := []string{}
path := filepath.Join(b.homeKantraDir, RulesetsLocation)
path := filepath.Join(b.homeKantraDir, "rulesets")
aufi marked this conversation as resolved.
Show resolved Hide resolved
if _, err := os.Stat(path); os.IsNotExist(err) {
b.log.Error(err, "cannot find ruleset, ensure containerless-kantra-deps are in place")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets change this to specifically mention that we can't find the rulesets directory. Then add validation for the other deps

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will make this logic more specific and move most of it to the command validation function.

return nil, err
}
err := filepath.WalkDir(path, walkRuleSets(path, label, &labelsSlice))
if err != nil {
return nil, err
Expand Down
Loading