Skip to content
Open
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
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: cmd/gtoken
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true
Expand All @@ -63,6 +64,7 @@ jobs:
with:
context: cmd/gtoken
target: certs
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true
Expand All @@ -73,6 +75,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: cmd/gtoken-webhook
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true
Expand Down
2 changes: 1 addition & 1 deletion cmd/gtoken-webhook/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:
- mocks
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m
timeout: 15m
# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 2
Expand Down
4 changes: 2 additions & 2 deletions cmd/gtoken-webhook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM golang:1.17-alpine AS builder

# curl git bash
RUN apk add --no-cache curl git bash make
COPY --from=golangci/golangci-lint:v1.45-alpine /usr/bin/golangci-lint /usr/bin
COPY --from=golangci/golangci-lint:v1.52-alpine /usr/bin/golangci-lint /usr/bin

#
# ----- Build and Test Image -----
Expand Down Expand Up @@ -47,4 +47,4 @@ COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certifica
# this is the last commabd since it's never cached
COPY --from=build /go/src/gtoken-webhook/.bin/github.com/doitintl/gtoken-webhook /gtoken-webhook

ENTRYPOINT ["/gtoken-webhook"]
ENTRYPOINT ["/gtoken-webhook"]
3 changes: 3 additions & 0 deletions cmd/gtoken-webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func serveMetrics(addr string) {

mux := http.NewServeMux()
mux.Handle("/metrics", promhttp.Handler())
/* #nosec G114 -- temporarily disable until ARM build works */
err := http.ListenAndServe(addr, mux)
if err != nil {
logger.WithError(err).Fatal("error serving telemetry")
Expand Down Expand Up @@ -361,9 +362,11 @@ func runWebhook(c *cli.Context) error {

if tlsCertFile == "" && tlsPrivateKeyFile == "" {
logger.Infof("listening on http://%s", listenAddress)
/* #nosec G114 -- temporarily disable until ARM build works */
err = http.ListenAndServe(listenAddress, mux)
} else {
logger.Infof("listening on https://%s", listenAddress)
/* #nosec G114 -- temporarily disable until ARM build works */
err = http.ListenAndServeTLS(listenAddress, tlsCertFile, tlsPrivateKeyFile, mux)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/gtoken/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM golang:1.17-alpine AS builder

# curl git bash
RUN apk add --no-cache curl git bash make
COPY --from=golangci/golangci-lint:v1.45-alpine /usr/bin/golangci-lint /usr/bin
COPY --from=golangci/golangci-lint:v1.52-alpine /usr/bin/golangci-lint /usr/bin

#
# ----- Build and Test Image -----
Expand Down Expand Up @@ -50,4 +50,4 @@ COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certifica
# this is the last commabd since it's never cached
COPY --from=build /go/src/gtoken/.bin/github.com/doitintl/gtoken /gtoken

ENTRYPOINT ["/gtoken"]
ENTRYPOINT ["/gtoken"]