Skip to content

Commit 26faf8f

Browse files
feat: add support for plugin index (#6674)
Signed-off-by: knqyf263 <[email protected]> Co-authored-by: DmitriyLewen <[email protected]>
1 parent 150a773 commit 26faf8f

File tree

27 files changed

+1444
-697
lines changed

27 files changed

+1444
-697
lines changed

.github/workflows/semantic-pr.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
k8s
4545
aws
4646
vm
47+
plugin
4748
4849
alpine
4950
wolfi

cmd/trivy/main.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ func main() {
2828
func run() error {
2929
// Trivy behaves as the specified plugin.
3030
if runAsPlugin := os.Getenv("TRIVY_RUN_AS_PLUGIN"); runAsPlugin != "" {
31-
if !plugin.IsPredefined(runAsPlugin) {
32-
return xerrors.Errorf("unknown plugin: %s", runAsPlugin)
33-
}
34-
if err := plugin.RunWithURL(context.Background(), runAsPlugin, plugin.RunOptions{Args: os.Args[1:]}); err != nil {
31+
if err := plugin.RunWithURL(context.Background(), runAsPlugin, plugin.Options{Args: os.Args[1:]}); err != nil {
3532
return xerrors.Errorf("plugin error: %w", err)
3633
}
3734
return nil

docs/community/contribute/pr.md

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ mode:
114114
- server
115115
- aws
116116
- vm
117+
- plugin
117118

118119
os:
119120

docs/docs/advanced/plugins.md

-236
This file was deleted.

docs/docs/configuration/reporting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ $ trivy <target> [--format <format>] --output plugin=<plugin_name> [--output-plu
399399
```
400400

401401
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.
402-
For more details, please check [here](../advanced/plugins.md#output-plugins).
402+
For more details, please check [here](../plugin/plugins.md#output-plugins).
403403

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

0 commit comments

Comments
 (0)