Skip to content

Commit

Permalink
fix: update image
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Dec 14, 2024
1 parent 1933865 commit 56cbe99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM docker.io/golang:alpine as build
RUN apk --no-cache add ca-certificates curl

# Download and install Grype
RUN curl -sSfL https://github.com/anchore/grype/releases/download/v0.73.0/grype_0.73.0_linux_amd64.tar.gz | tar -xz -C /usr/local/bin grype
RUN curl -sSfL https://github.com/anchore/grype/releases/download/v0.86.1/grype_0.86.1_linux_amd64.tar.gz | tar -xz -C /usr/local/bin grype

# Verify installation
RUN grype version
Expand Down
4 changes: 0 additions & 4 deletions task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@

grype version

curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin

grype version

grype ghcr.io/opengovern/steampipe-plugin-aws:v0.1.6 --scope all-layers -o cyclonedx-json
grype nginx:latest --scope all-layers -o cyclonedx-json
6 changes: 2 additions & 4 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ func (w *Worker) ProcessMessage(ctx context.Context, msg jetstream.Msg) (err err
output, err := cmd.CombinedOutput()
if err != nil {
w.logger.Error("error running grype", zap.Error(err))
cmd = exec.Command("./task.sh")
cmd = exec.Command("task.sh")
output, err = cmd.CombinedOutput()
if err != nil {
w.logger.Error("error running grype script", zap.Error(err))
}
}
w.logger.Info("output", zap.String("output", string(output)))

response.Result = output
response.RunID = request.RunID
Expand All @@ -164,8 +165,5 @@ func (w *Worker) ProcessMessage(ctx context.Context, msg jetstream.Msg) (err err
return err
}

if _, err = w.jq.Produce(ctx, ResultTopicName, responseJson, fmt.Sprintf("task-%d", request.RunID)); err != nil {
w.logger.Error("failed to publish job in progress", zap.String("response", string(responseJson)), zap.Error(err))
}
return nil
}

0 comments on commit 56cbe99

Please sign in to comment.