From 2178f1f42eac79c6808fc82ef10b9de0aa1291d0 Mon Sep 17 00:00:00 2001 From: Dustin Decker Date: Mon, 13 Jun 2022 16:14:22 -0700 Subject: [PATCH] reword and fix error logging --- Dockerfile | 2 +- Dockerfile.goreleaser | 1 + pkg/sources/s3/s3.go | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb910ff88057..0e7492ff527d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY . . RUN CGO_ENABLED=0 go build -a -o trufflehog main.go FROM alpine:3.15 -RUN apk add --no-cache git +RUN apk add --no-cache git; mkdir /tmp COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /build/trufflehog /usr/bin/trufflehog ENTRYPOINT ["/usr/bin/trufflehog"] diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser index e2834ec2eb15..ac7c9e4ca4a4 100644 --- a/Dockerfile.goreleaser +++ b/Dockerfile.goreleaser @@ -2,6 +2,7 @@ FROM alpine:3.15 RUN apk add --no-cache git WORKDIR /usr/bin/ +RUN mkdir /tmp COPY trufflehog . ENTRYPOINT ["/usr/bin/trufflehog"] diff --git a/pkg/sources/s3/s3.go b/pkg/sources/s3/s3.go index 9e64b1b12ab1..ca34f64137ab 100644 --- a/pkg/sources/s3/s3.go +++ b/pkg/sources/s3/s3.go @@ -248,9 +248,9 @@ func (s *Source) pageChunker(ctx context.Context, client *s3.S3, chunksChan chan errorCount.Store(prefix, nErr) //too many consective errors on this page if nErr.(int) > 3 { - s.log.Warnf("Too many consecutive errors. Blacklisting %s", prefix) + s.log.Warnf("Too many consecutive errors. Excluding %s", prefix) } - log.Debugf("Error Counts: %s:%s", prefix, nErr) + log.Debugf("Error Counts: %s:%d", prefix, nErr) return } body, err := ioutil.ReadAll(res.Body) @@ -269,7 +269,7 @@ func (s *Source) pageChunker(ctx context.Context, client *s3.S3, chunksChan chan errorCount.Store(prefix, nErr) if nErr.(int) > 3 { - s.log.Warnf("Too many consecutive errors. Blacklisting %s", prefix) + s.log.Warnf("Too many consecutive errors. Excluding %s", prefix) } return }