This repository was archived by the owner on Mar 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 run : echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
2323 - name : Build and push acorn
2424 run : |
25- acorn build --platform linux/amd64 --platform linux/arm64 -t ghcr.io/acorn-io/acorn-dns:$TAG .
25+ acorn build --platform linux/amd64 --platform linux/arm64 -t ghcr.io/acorn-io/acorn-dns:$TAG . --tag=$TAG
2626 acorn push ghcr.io/acorn-io/acorn-dns:$TAG
Original file line number Diff line number Diff line change @@ -7,12 +7,18 @@ args: {
77
88 // The AWS Route53 zone where FQDNs will be created
99 route53ZoneId: ""
10+
11+ // The tag that should be displayed in version information
12+ tag: "v0.0.0-dev"
1013}
1114
1215containers: {
1316 default: {
1417 dependsOn: "db"
1518 build: {
19+ buildArgs: {
20+ TAG: args.tag
21+ }
1622 context: "."
1723 }
1824 scale: args.scale
Original file line number Diff line number Diff line change 11FROM golang:1.18 AS build
22COPY / /src
33WORKDIR /src
4- RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build make build
4+ ARG TAG="v0.0.0-dev"
5+ ENV CGO_ENABLED=0
6+ RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build \
7+ go build -o bin/acorn-dns -ldflags "-s -w -X 'github.com/acorn-io/acorn-dns/pkg/version.Tag=${TAG}'" .
58
69FROM alpine:3.16.1 AS base
710RUN apk add --no-cache ca-certificates
Original file line number Diff line number Diff line change @@ -25,11 +25,7 @@ func newHandler(b backend.Backend) *handler {
2525
2626func (h * handler ) root (w http.ResponseWriter , r * http.Request ) {
2727 v := version .Get ()
28- if err := json .NewEncoder (w ).Encode (v ); err != nil {
29- w .WriteHeader (500 )
30- _ , _ = w .Write ([]byte (`{"success": false}` ))
31- }
32- w .WriteHeader (200 )
28+ writeSuccess (w , http .StatusOK , v )
3329}
3430
3531func (h * handler ) getDomain (w http.ResponseWriter , r * http.Request ) {
Original file line number Diff line number Diff line change @@ -69,8 +69,6 @@ func loggingMiddleware(logger *logrus.Entry) func(http.Handler) http.Handler {
6969 wrapped := wrapResponseWriter (w )
7070 next .ServeHTTP (wrapped , r )
7171
72- // Per Shannon Huff 2021-11-20, only log requests if it's not
73- // a health check request
7472 if ! strings .Contains (r .URL .EscapedPath (), "healthz" ) {
7573 logger .WithFields (logrus.Fields {
7674 "status" : wrapped .status ,
You can’t perform that action at this time.
0 commit comments