Skip to content

Commit 69edc49

Browse files
committed
fix: scan and helm install command update
1 parent fbad6ed commit 69edc49

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cmd/sdkr/scan.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
"github.com/spf13/cobra"
1010
)
1111

12-
var timeout int
13-
1412
// scanCmd provides functionality to scan a Docker image for known security issues.
1513
// It supports both direct command-line arguments and configuration file values for the image name,
1614
// and optionally allows saving the scan report to a specified SARIF file.
@@ -36,7 +34,7 @@ var scanCmd = &cobra.Command{
3634
}
3735

3836
pterm.Info.Printf("Scanning Docker image %q...\n", imageRef)
39-
err := docker.Trivy(imageRef, timeout, useAI)
37+
err := docker.Trivy(imageRef, useAI)
4038
if err != nil {
4139
return err
4240
}
@@ -53,6 +51,5 @@ var scanCmd = &cobra.Command{
5351

5452
func init() {
5553
scanCmd.Flags().BoolVar(&useAI, "ai", false, "To enable AI help mode, export the OPENAI_API_KEY environment variable with your OpenAI API key.")
56-
scanCmd.Flags().IntVar(&timeout, "timeout", 600, "timeout for docker image scan")
5754
sdkrCmd.AddCommand(scanCmd)
5855
}

internal/docker/scan.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212

1313
// Trivy runs 'trivy image' to scan a Docker image for vulnerabilities
1414
// and displays the results. It's a simplified version that accepts just the image name and tag.
15-
func Trivy(dockerImage string, timeout int, useAI bool) error {
15+
func Trivy(dockerImage string, useAI bool) error {
1616
ctx := context.Background()
17-
args := []string{"image", dockerImage, string(timeout), "--format", "table"}
17+
args := []string{"image", dockerImage, "--format", "table"}
1818

1919
cmd := exec.CommandContext(ctx, "trivy", args...)
2020
var stdoutBuf, stderrBuf bytes.Buffer

0 commit comments

Comments
 (0)