This repository was archived by the owner on Mar 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +12
-9
lines changed Expand file tree Collapse file tree 5 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 22
22
run : echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
23
23
- name : Build and push acorn
24
24
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
26
26
acorn push ghcr.io/acorn-io/acorn-dns:$TAG
Original file line number Diff line number Diff line change @@ -7,12 +7,18 @@ args: {
7
7
8
8
// The AWS Route53 zone where FQDNs will be created
9
9
route53ZoneId: ""
10
+
11
+ // The tag that should be displayed in version information
12
+ tag: "v0.0.0-dev"
10
13
}
11
14
12
15
containers: {
13
16
default: {
14
17
dependsOn: "db"
15
18
build: {
19
+ buildArgs: {
20
+ TAG: args.tag
21
+ }
16
22
context: "."
17
23
}
18
24
scale: args.scale
Original file line number Diff line number Diff line change 1
1
FROM golang:1.18 AS build
2
2
COPY / /src
3
3
WORKDIR /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}'" .
5
8
6
9
FROM alpine:3.16.1 AS base
7
10
RUN 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 {
25
25
26
26
func (h * handler ) root (w http.ResponseWriter , r * http.Request ) {
27
27
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 )
33
29
}
34
30
35
31
func (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 {
69
69
wrapped := wrapResponseWriter (w )
70
70
next .ServeHTTP (wrapped , r )
71
71
72
- // Per Shannon Huff 2021-11-20, only log requests if it's not
73
- // a health check request
74
72
if ! strings .Contains (r .URL .EscapedPath (), "healthz" ) {
75
73
logger .WithFields (logrus.Fields {
76
74
"status" : wrapped .status ,
You can’t perform that action at this time.
0 commit comments