Skip to content

Commit

Permalink
Merge pull request #35 from contentful-labs/coredns-185
Browse files Browse the repository at this point in the history
feat: coredns 1.8.5 and go 1.17
  • Loading branch information
johanneswuerbach authored Sep 22, 2021
2 parents b1adfcf + faa2e13 commit 4e14d1e
Show file tree
Hide file tree
Showing 199 changed files with 6,944 additions and 5,593 deletions.
15 changes: 7 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ executors:
environment:
IMAGE_NAME: contentful/coredns-nodecache
machine:
image: ubuntu-2004:202107-02
docker_layer_caching: true
jobs:
lint:
machine:
docker_layer_caching: true
executor: docker-publisher
steps:
- checkout
- run: make lint
test:
machine:
docker_layer_caching: true
executor: docker-publisher
steps:
- checkout
- run: make test
- run: make test
build:
executor: docker-publisher
steps:
Expand Down Expand Up @@ -67,7 +66,7 @@ jobs:
name: Load archived Docker image
command: docker load -i /tmp/workspace/image.tar
- run:
name: publish docker image with latest tag
name: publish docker image with latest tag
command: |
docker tag contentful-labs/coredns-nodecache:latest $IMAGE_NAME:latest
echo "$docker_password" | docker login -u "$docker_login" --password-stdin
Expand All @@ -80,7 +79,7 @@ workflows:
- test:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
- build:
filters:
tags:
Expand Down Expand Up @@ -113,4 +112,4 @@ workflows:
- test
filters:
branches:
only: master
only: master
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.16-buster AS builder
FROM golang:1.17-buster AS builder

RUN apt update && apt upgrade -y && apt install iptables -y

RUN git clone --single-branch --branch v1.8.4 https://github.com/coredns/coredns.git /coredns
RUN git clone --single-branch --branch v1.8.5 https://github.com/coredns/coredns.git /coredns

WORKDIR /coredns

Expand All @@ -13,11 +13,10 @@ RUN mkdir -p plugin/nodecache
RUN echo 'nodecache:nodecache' >> /coredns/plugin.cfg

COPY *.go /coredns/plugin/nodecache/
RUN go get github.com/coreos/go-iptables@f901d6c2a4f2a4df092b98c33366dfba1f93d7a0 github.com/vishvananda/netlink@f049be6f391489d3f374498fe0c8df8449258372
RUN make
RUN chmod 0755 /coredns/coredns

FROM alpine:3.13
FROM alpine:3.14
RUN apk add iptables

COPY --from=builder /coredns/coredns /
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ build:
run: build
docker run --cap-add=NET_ADMIN --cap-add=NET_RAW --privileged -P contentful-labs/coredns-nodecache

test:
docker run -ti -e GO111MODULE=on -v $$PWD:/go/src/github.com/contentful-labs/coredns-nodecache \
-w /go/src/github.com/contentful-labs/coredns-nodecache/ golang:1.13-stretch go test -v -mod=vendor ./...
test:
docker run -ti -v $$PWD:/go/src/github.com/contentful-labs/coredns-nodecache \
-w /go/src/github.com/contentful-labs/coredns-nodecache/ golang:1.17-buster go test -v -mod=vendor ./...

lint:
docker run -ti -e GO111MODULE=on -v $$PWD:/go/src/github.com/contentful-labs/coredns-nodecache \
-w /go/src/github.com/contentful-labs/coredns-nodecache/ golangci/golangci-lint:v1.23.7 golangci-lint run
docker run -ti -v $$PWD:/go/src/github.com/contentful-labs/coredns-nodecache \
-w /go/src/github.com/contentful-labs/coredns-nodecache/ golangci/golangci-lint:v1.42.1 golangci-lint run
32 changes: 27 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
module github.com/contentful/coredns-nodecache

go 1.13
go 1.17

require (
github.com/coredns/caddy v1.1.0
github.com/coredns/coredns v1.8.4
github.com/coreos/go-iptables v0.4.5
github.com/coredns/caddy v1.1.1
github.com/coredns/coredns v1.8.5
github.com/coreos/go-iptables v0.6.0
github.com/vishvananda/netlink v1.1.0
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
golang.org/x/sys v0.0.0-20210921065528-437939a70204
)

require (
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.30.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
)
Loading

0 comments on commit 4e14d1e

Please sign in to comment.