Skip to content

Commit

Permalink
add Opts to SOFA unpatched
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikelee committed May 30, 2024
1 parent 8fa354b commit 85b8568
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tables/sofa/sofa_cves.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func SofaUnpatchedCVEsColumns() []table.ColumnDefinition {
}
}

func SofaUnpatchedCVEsGenerate(ctx context.Context, queryContext table.QueryContext, socketPath string) ([]map[string]string, error) {
func SofaUnpatchedCVEsGenerate(ctx context.Context, queryContext table.QueryContext, socketPath string, opts ...Option) ([]map[string]string, error) {
url := SofaV1URL
if constraintList, present := queryContext.Constraints["url"]; present {
// 'url' is in the where clause
Expand Down Expand Up @@ -61,7 +61,12 @@ func SofaUnpatchedCVEsGenerate(ctx context.Context, queryContext table.QueryCont
}
}

client, err := NewSofaClient(WithURL(url))
defaultOpts := []Option{
WithURL(url),
}
opts = append(opts, defaultOpts...)

client, err := NewSofaClient(opts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 85b8568

Please sign in to comment.