@@ -23,6 +23,7 @@ import (
23
23
"github.com/falcosecurity/falcoctl/internal/config"
24
24
"github.com/falcosecurity/falcoctl/internal/utils"
25
25
"github.com/falcosecurity/falcoctl/pkg/index"
26
+ "github.com/falcosecurity/falcoctl/pkg/oci"
26
27
"github.com/falcosecurity/falcoctl/pkg/options"
27
28
"github.com/falcosecurity/falcoctl/pkg/output"
28
29
)
@@ -33,7 +34,8 @@ const (
33
34
34
35
type artifactSearchOptions struct {
35
36
* options.CommonOptions
36
- minScore float64
37
+ minScore float64
38
+ artifactType oci.ArtifactType
37
39
}
38
40
39
41
func (o * artifactSearchOptions ) Validate () error {
@@ -67,6 +69,8 @@ func NewArtifactSearchCmd(ctx context.Context, opt *options.CommonOptions) *cobr
67
69
cmd .Flags ().Float64VarP (& o .minScore , "min-score" , "" , defaultMinScore ,
68
70
"the minimum score used to match artifact names with search keywords" )
69
71
72
+ cmd .Flags ().Var (& o .artifactType , "type" , `Only search artifacts with a specific type. Allowed values: "rulesfile", "plugin""` )
73
+
70
74
return cmd
71
75
}
72
76
@@ -85,6 +89,9 @@ func (o *artifactSearchOptions) RunArtifactSearch(ctx context.Context, args []st
85
89
86
90
var data [][]string
87
91
for _ , entry := range resultEntries {
92
+ if o .artifactType != "" && o .artifactType != oci .ArtifactType (entry .Type ) {
93
+ continue
94
+ }
88
95
indexName := mergedIndexes .IndexByEntry (entry ).Name
89
96
row := []string {indexName , entry .Name , entry .Type , entry .Registry , entry .Repository }
90
97
data = append (data , row )
0 commit comments