Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 3 additions & 3 deletions cmd/crowdsec-cli/cliitem/cmdinspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (cli *cliItem) inspect(ctx context.Context, args []string, url string, diff

wantMetrics := !noMetrics && item.State.IsInstalled()

if err := inspectItem(hub, item, wantMetrics, cfg.Cscli.Output, cfg.Cscli.PrometheusUrl, cfg.Cscli.Color); err != nil {
if err := inspectItem(ctx, hub, item, wantMetrics, cfg.Cscli.Output, cfg.Cscli.PrometheusUrl, cfg.Cscli.Color); err != nil {
return err
}

Expand Down Expand Up @@ -200,7 +200,7 @@ func (cli *cliItem) newInspectCmd() *cobra.Command {
return cmd
}

func inspectItem(hub *cwhub.Hub, item *cwhub.Item, wantMetrics bool, output string, prometheusURL string, wantColor string) error {
func inspectItem(ctx context.Context, hub *cwhub.Hub, item *cwhub.Item, wantMetrics bool, output string, prometheusURL string, wantColor string) error {
// This is dirty...
// We want to show current dependencies (from content), not latest (from index).
// The item is modifed but after this function the whole hub should be thrown away.
Expand Down Expand Up @@ -235,7 +235,7 @@ func inspectItem(hub *cwhub.Hub, item *cwhub.Item, wantMetrics bool, output stri
if wantMetrics {
fmt.Fprint(os.Stdout, "\nCurrent metrics: \n")

if err := showMetrics(prometheusURL, hub, item, wantColor); err != nil {
if err := showMetrics(ctx, prometheusURL, hub, item, wantColor); err != nil {
return err
}
}
Expand Down
Loading