Skip to content

Commit cb6107e

Browse files
committed
add healthcheck port
1 parent ece8df4 commit cb6107e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ fmt:
77
opa fmt policy/*/*.rego -w
88

99
lint:
10-
golangci-lint run --enable bodyclose --enable exportloopref --out-format=colored-line-number --timeout 10m
10+
golangci-lint run --enable bodyclose --enable exportloopref --out-format=colored-line-number --timeout 10m
11+
12+
docker:
13+
docker buildx build --push \
14+
--platform linux/amd64,linux/arm64 \
15+
--tag us-docker.pkg.dev/thog-artifacts/public/logwarden:latest .

gcp-auditor

28.7 MB
Binary file not shown.

main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"context"
55
"log"
6+
"net/http"
67
"os"
78

89
"github.com/trufflesecurity/logwarden/internal/engine"
@@ -72,6 +73,17 @@ func main() {
7273
}
7374
}()
7475

76+
go func() {
77+
port := os.Getenv("PORT")
78+
if port == "" {
79+
port = "8080"
80+
}
81+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
82+
w.WriteHeader(http.StatusOK)
83+
})
84+
log.Fatal(http.ListenAndServe(":"+port, nil))
85+
}()
86+
7587
err = eng.Subscribe(ctx, *project, *subscription)
7688
if err != nil {
7789
log.Fatal(err)

0 commit comments

Comments
 (0)