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

feat: add support for plugin index #6674

Merged
merged 26 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
822a133
feat: add support for plugin index
knqyf263 May 9, 2024
486eb48
feat(plugin): output mode
knqyf263 May 10, 2024
ddbed50
docs: add user-guide and developer-guide
knqyf263 May 10, 2024
b69a5a8
feat: add installed platform
knqyf263 May 10, 2024
bf0847d
test: respect XDG_DATA_HOME
knqyf263 May 13, 2024
a7c71fa
docs: auto-generate references
knqyf263 May 13, 2024
8553252
docs: update a developer guide
knqyf263 May 13, 2024
739c0e9
Use NoArgs
knqyf263 May 13, 2024
9051fef
Update docs/docs/plugin/user-guide.md
knqyf263 May 13, 2024
d41b592
refactor: remove unneeded PersistentRun
knqyf263 May 13, 2024
9dbecdf
fix(plugin): delay initilizing plugin manager
knqyf263 May 13, 2024
2fcd08b
fix: remove MaximumNArgs
knqyf263 May 13, 2024
d2f2e96
refactor: pass one argument as a keyword
knqyf263 May 13, 2024
5a64f2d
feat: replace usage with summary
knqyf263 May 13, 2024
6bcd91b
test: use a common error message
knqyf263 May 13, 2024
39ce40e
docs: mention the keyword matches name or desc
knqyf263 May 13, 2024
466b9f5
chore: add info for successful installation
knqyf263 May 13, 2024
7e62137
chore: fix usage
knqyf263 May 13, 2024
1a5f094
docs: update the developer guide
knqyf263 May 13, 2024
99ab575
Update docs/docs/plugin/user-guide.md
knqyf263 May 14, 2024
c622be1
Update docs/docs/plugin/index.md
knqyf263 May 14, 2024
a240e52
docs: update mkdocs
knqyf263 May 14, 2024
60f4848
fix: use a local logger
knqyf263 May 14, 2024
1835268
fix: add SilenceUsage
knqyf263 May 14, 2024
2fe4f21
chore: add a message on uninstallation
knqyf263 May 14, 2024
7fae791
feat: add version to the index
knqyf263 May 14, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/semantic-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
k8s
aws
vm
plugin
alpine
wolfi
Expand Down
5 changes: 1 addition & 4 deletions cmd/trivy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ func main() {
func run() error {
// Trivy behaves as the specified plugin.
if runAsPlugin := os.Getenv("TRIVY_RUN_AS_PLUGIN"); runAsPlugin != "" {
if !plugin.IsPredefined(runAsPlugin) {
return xerrors.Errorf("unknown plugin: %s", runAsPlugin)
}
if err := plugin.RunWithURL(context.Background(), runAsPlugin, plugin.RunOptions{Args: os.Args[1:]}); err != nil {
if err := plugin.RunWithURL(context.Background(), runAsPlugin, plugin.Options{Args: os.Args[1:]}); err != nil {
return xerrors.Errorf("plugin error: %w", err)
}
return nil
Expand Down
1 change: 1 addition & 0 deletions docs/community/contribute/pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ mode:
- server
- aws
- vm
- plugin

os:

Expand Down
236 changes: 0 additions & 236 deletions docs/docs/advanced/plugins.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/docs/configuration/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ $ trivy <target> [--format <format>] --output plugin=<plugin_name> [--output-plu
```

This is useful for cases where you want to convert the output into a custom format, or when you want to send the output somewhere.
For more details, please check [here](../advanced/plugins.md#output-plugins).
For more details, please check [here](../plugin/plugins.md#output-plugins).

## Converting
To generate multiple reports, you can generate the JSON report first and convert it to other formats with the `convert` subcommand.
Expand Down
Loading