From 9ccb447d6c5d88682e2c9152b6a9bf4530098d2d Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 14 Jan 2022 21:25:52 +0000 Subject: [PATCH 01/33] feat: add retry and aaaa plugin to plugin.cfg --- plugin.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin.cfg b/plugin.cfg index 628e7141294..e7d84a107b8 100644 --- a/plugin.cfg +++ b/plugin.cfg @@ -41,6 +41,7 @@ local:local dns64:dns64 acl:acl any:any +aaaa:github.com/snapp-incubator/coredns-plugins/aaaa chaos:chaos loadbalance:loadbalance cache:cache @@ -62,6 +63,8 @@ auto:auto secondary:secondary etcd:etcd loop:loop +retry:github.com/snapp-incubator/coredns-plugins/retry +fanout:github.com/snapp-incubator/fanout forward:forward grpc:grpc erratic:erratic From 6b1a6a05ad47bb9fad7807f49361dcf2e8dced3a Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:40:37 +0330 Subject: [PATCH 02/33] fix: : add build stage to dockerfile --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9c46085891b..c3df5b0fbf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,22 @@ +#build stage +FROM golang:1.16 AS builder +RUN mkdir -p /go/src/app +COPY go.sum go.mod /go/src/app/ +WORKDIR /go/src/app +RUN go mod download + +COPY . /go/src/app +RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o coredns + FROM debian:stable-slim RUN apt-get update && apt-get -uy upgrade RUN apt-get -y install ca-certificates && update-ca-certificates FROM scratch - COPY --from=0 /etc/ssl/certs /etc/ssl/certs -ADD coredns /coredns +WORKDIR / +COPY --from=builder /go/src/app/coredns /coredns EXPOSE 53 53/udp ENTRYPOINT ["/coredns"] From 1eda2c57cf8dfac4068669f2e9a8ea20ebf435b7 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:42:38 +0330 Subject: [PATCH 03/33] fix: to be able to copy files to build stage --- .dockerignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 1ff16c577e9..062169dc115 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1 @@ -* !coredns From 759315b7d51638db12091f3bd0c3ce443e017171 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:44:27 +0330 Subject: [PATCH 04/33] delete: unnecessary github action --- .github/workflows/codeql-analysis.yml | 34 --------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 524161be86f..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - schedule: - - cron: '22 10 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 From 34adb4e17015a3b1997d6e9059c67733de37210b Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:44:44 +0330 Subject: [PATCH 05/33] delete: unnecessary github action --- .github/workflows/go.coverage.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/go.coverage.yml diff --git a/.github/workflows/go.coverage.yml b/.github/workflows/go.coverage.yml deleted file mode 100644 index 9ea6cfb967a..00000000000 --- a/.github/workflows/go.coverage.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Go Coverage -on: [pull_request] -jobs: - test: - name: Coverage - runs-on: ubuntu-latest - steps: - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: '1.17.0' - id: go - - - name: Check out code - uses: actions/checkout@v2 - - - name: Build - run: go build -v ./... - - - name: Test With Coverage - run: | - for d in request core coremain plugin test; do \ - ( cd $d; go test -coverprofile=cover.out -covermode=atomic -race ./...; [ -f cover.out ] && cat cover.out >> ../coverage.txt ); \ - done - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2.1.0 From cebdeb9ddddf151c2135beb5614c14c51994cdb6 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:45:00 +0330 Subject: [PATCH 06/33] delete: unnecessary github action --- .github/workflows/make.doc.yml | 40 ---------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/make.doc.yml diff --git a/.github/workflows/make.doc.yml b/.github/workflows/make.doc.yml deleted file mode 100644 index 4ab9df5eba6..00000000000 --- a/.github/workflows/make.doc.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Make Doc - -on: - schedule: - - cron: '22 10 * * 0' - -jobs: - fix: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: '1.17.0' - - - name: Update Docs - run: | - bash -x -e ./.github/fixup_file_mtime.sh - make -f Makefile.doc - - - name: Set up Git - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "coredns[bot]" - git config user.email "bot@bot.coredns.io" - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - - - name: Commit and push changes - run: | - set -x -e - git add . - if output=$(git status --porcelain) && [ ! -z "$output" ]; then - git commit -s -m 'auto make -f Makefile.doc' - git push - fi From a8af53c49fb38b41478ba547e489b786a6cf749c Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:45:13 +0330 Subject: [PATCH 07/33] delete: unnecessary github action --- .github/workflows/go.test.yml | 85 ----------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 .github/workflows/go.test.yml diff --git a/.github/workflows/go.test.yml b/.github/workflows/go.test.yml deleted file mode 100644 index c536278b266..00000000000 --- a/.github/workflows/go.test.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Go Tests -on: [push, pull_request] -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: '1.17.0' - id: go - - - name: Check out code - uses: actions/checkout@v2 - - - name: Build - run: go build -v ./... - - - name: Test - run: | - ( cd request; go test -race ./... ) - ( cd core; go test -race ./... ) - ( cd coremain; go test -race ./... ) - - test-plugins: - name: Test Plugins - runs-on: ubuntu-latest - steps: - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: '1.17.0' - id: go - - - name: Check out code - uses: actions/checkout@v2 - - - name: Build - run: go build -v ./... - - - name: Test - run: ( cd plugin; go test -race ./... ) - - test-e2e: - name: Test e2e - runs-on: ubuntu-latest - steps: - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: '1.17.0' - id: go - - - name: Check out code - uses: actions/checkout@v2 - - - name: Build - run: go build -v ./... - - - name: Test - run: | - go install github.com/fatih/faillint || true - ( cd test; go test -race ./... ) - - test-makefile-release: - name: Test Makefile.release - runs-on: ubuntu-latest - steps: - - - name: Install dependencies - run: | - sudo apt-get install make curl - - - name: Check out code - uses: actions/checkout@v2 - - - name: Test Makefile.release - run: make GITHUB_ACCESS_TOKEN=x -n release github-push -f Makefile.release - - - name: Test Makefile.docker - run: make VERSION=x DOCKER=x -n release docker-push -f Makefile.docker From 4d7348875672bafcdf0d7f0e1ec49bbdff433c83 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:45:34 +0330 Subject: [PATCH 08/33] delete: unnecessary github action --- .github/workflows/go.tidy.yml | 40 ----------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/go.tidy.yml diff --git a/.github/workflows/go.tidy.yml b/.github/workflows/go.tidy.yml deleted file mode 100644 index d5e8361ea6d..00000000000 --- a/.github/workflows/go.tidy.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Go Tidy - -on: - schedule: - - cron: '22 10 * * 3' - -jobs: - fix: - runs-on: ubuntu-latest - steps: - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: '1.17.0' - id: go - - - name: Checkout - uses: actions/checkout@v2 - - - name: Tidy - run: | - rm -f go.sum - go mod tidy - - - name: Set up Git - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "coredns[bot]" - git config user.email "bot@bot.coredns.io" - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - - - name: Commit and push changes - run: | - git add . - if output=$(git status --porcelain) && [ ! -z "$output" ]; then - git commit -s -m 'auto go mod tidy' - git push - fi From 29278162ca5ca557f2448b2ac05bb66c2a0fd896 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:45:53 +0330 Subject: [PATCH 09/33] delete: unnecessary github action --- .github/workflows/whitespace.yml | 33 -------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .github/workflows/whitespace.yml diff --git a/.github/workflows/whitespace.yml b/.github/workflows/whitespace.yml deleted file mode 100644 index 26f9ba0156e..00000000000 --- a/.github/workflows/whitespace.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Remove Trailing Whitespaces - -on: - schedule: - - cron: '22 10 * * 2' - -jobs: - fix: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Remove Trailing Whitespaces - run: | - find . -not -path '*/\.git/*' -type f -not -name '*.go' -exec sed -i 's/[[:space:]]\{1,\}$//' {} \+ - - - name: Set up Git - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "coredns[bot]" - git config user.email "bot@bot.coredns.io" - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - - - name: Commit and push changes - run: | - git add . - if output=$(git status --porcelain) && [ ! -z "$output" ]; then - git commit -s -m 'auto remove trailing whitespaces' - git push - fi From 894663e9bd12f088a69eb28ca4f101de87829e80 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:49:02 +0330 Subject: [PATCH 10/33] feat: add CI to build and push coredns --- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..75bb34c40d8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +--- +name: ci +on: + push: + branches: [ main ] + tags: [ v* ] + pull_request: + branches: [ main ] +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '^1.16.0' + - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out + - uses: codecov/codecov-action@v1 + with: + files: coverage.out + docker: + name: docker + runs-on: ubuntu-latest + needs: + - test + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/metadata-action@v3 + id: meta + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - uses: docker/build-push-action@v2 + with: + file: "Dockerfile" + context: . + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 9ab7fbc6b57f8a08ae6761e17c0a5a9e66affd19 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Sat, 15 Jan 2022 22:50:11 +0330 Subject: [PATCH 11/33] fix: update CI action --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75bb34c40d8..4db93d8552f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: ci on: push: - branches: [ main ] - tags: [ v* ] + branches: [ v1.8.6.1 ] + tags: [ v1.8.6* ] pull_request: - branches: [ main ] + branches: [ v1.8.6.1 ] jobs: test: name: test From 3e680366e0d043a592a210a44d094a7f3011c39f Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Mon, 17 Jan 2022 11:47:13 +0330 Subject: [PATCH 12/33] remove tag --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4db93d8552f..14616557f32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,6 @@ name: ci on: push: branches: [ v1.8.6.1 ] - tags: [ v1.8.6* ] pull_request: branches: [ v1.8.6.1 ] jobs: From 444ba72128e8af80f3ea90841d93f956097eed56 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Mon, 17 Jan 2022 22:59:09 +0330 Subject: [PATCH 13/33] fix: update dockerfile --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3df5b0fbf9..1dc5107ea49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,15 +8,16 @@ RUN go mod download COPY . /go/src/app RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o coredns -FROM debian:stable-slim +FROM debian:stable-slim AS slim RUN apt-get update && apt-get -uy upgrade RUN apt-get -y install ca-certificates && update-ca-certificates +COPY --from=builder /go/src/app/coredns /coredns FROM scratch -COPY --from=0 /etc/ssl/certs /etc/ssl/certs +COPY --from=slim /etc/ssl/certs /etc/ssl/certs WORKDIR / -COPY --from=builder /go/src/app/coredns /coredns +COPY --from=slim /coredns /coredns EXPOSE 53 53/udp ENTRYPOINT ["/coredns"] From 24b866dfbb7a3d3e5905406dbe856993275eb0ec Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Mon, 17 Jan 2022 23:22:18 +0330 Subject: [PATCH 14/33] fix: update workflow action --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14616557f32..178b17681d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,8 @@ jobs: needs: - test steps: + - name: make coredns file + run: make - uses: actions/checkout@v2 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 From a8bb95357ef08860523c7a8e630c7c8a5b2985d5 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Tue, 18 Jan 2022 15:13:02 +0330 Subject: [PATCH 15/33] fix: add build job to actions --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 178b17681d9..a18982707fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,14 +18,23 @@ jobs: - uses: codecov/codecov-action@v1 with: files: coverage.out + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: configure + run: ./configure + + - name: Install dependencies + run: make docker: name: docker runs-on: ubuntu-latest needs: - test steps: - - name: make coredns file - run: make - uses: actions/checkout@v2 - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 From a6c4c64d4616bfa4733068faa1ef87955e1289eb Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Tue, 18 Jan 2022 15:16:48 +0330 Subject: [PATCH 16/33] fix: fix CI --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a18982707fd..be4389bb78c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,6 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: configure - run: ./configure - name: Install dependencies run: make From 56d85828013d2824f08d4d18ddd7ddce4956055a Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Tue, 18 Jan 2022 16:27:54 +0330 Subject: [PATCH 17/33] fix: add golan version to build section --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be4389bb78c..309d8904f4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,11 +19,12 @@ jobs: with: files: coverage.out build: - runs-on: ubuntu-latest - + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - + - uses: actions/setup-go@v2 + with: + go-version: '^1.16.0' - name: Install dependencies run: make docker: From 288d4a51047eb0d5c3218a886db2dfe323c23cce Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Tue, 18 Jan 2022 16:36:04 +0330 Subject: [PATCH 18/33] fix: fix ci chain --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 309d8904f4d..7fed1fe6dfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: files: coverage.out build: runs-on: ubuntu-latest + needs: + - test steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 @@ -31,7 +33,7 @@ jobs: name: docker runs-on: ubuntu-latest needs: - - test + - build steps: - uses: actions/checkout@v2 - uses: docker/setup-qemu-action@v1 From a6804d79f0a275d19dd7fde62eb8b8cd63194b7d Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Tue, 18 Jan 2022 17:31:28 +0330 Subject: [PATCH 19/33] fix: fix dockerfile builder stage --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1dc5107ea49..5318b069f22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /go/src/app RUN go mod download COPY . /go/src/app -RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o coredns +RUN make FROM debian:stable-slim AS slim From 287539e146eb3289efdca883a2ad5c3c73222ef8 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Fri, 21 Jan 2022 19:21:49 +0330 Subject: [PATCH 20/33] fix(ci) : update CI --- .github/workflows/ci.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fed1fe6dfd..14616557f32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,22 +18,11 @@ jobs: - uses: codecov/codecov-action@v1 with: files: coverage.out - build: - runs-on: ubuntu-latest - needs: - - test - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: '^1.16.0' - - name: Install dependencies - run: make docker: name: docker runs-on: ubuntu-latest needs: - - build + - test steps: - uses: actions/checkout@v2 - uses: docker/setup-qemu-action@v1 From 883ab54f7c553a68acf502790634d4e53536bc0e Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Fri, 21 Jan 2022 19:22:52 +0330 Subject: [PATCH 21/33] fix: update Dockerfile --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5318b069f22..101b551247b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,12 +12,11 @@ FROM debian:stable-slim AS slim RUN apt-get update && apt-get -uy upgrade RUN apt-get -y install ca-certificates && update-ca-certificates -COPY --from=builder /go/src/app/coredns /coredns FROM scratch COPY --from=slim /etc/ssl/certs /etc/ssl/certs WORKDIR / -COPY --from=slim /coredns /coredns +COPY --from=builder /coredns /coredns EXPOSE 53 53/udp ENTRYPOINT ["/coredns"] From 4333d19b9f938d8b458f08f4ed209ea8f1801cab Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Fri, 21 Jan 2022 19:30:06 +0330 Subject: [PATCH 22/33] fix: update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 101b551247b..87494d1ddee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get -y install ca-certificates && update-ca-certificates FROM scratch COPY --from=slim /etc/ssl/certs /etc/ssl/certs WORKDIR / -COPY --from=builder /coredns /coredns +COPY --from=builder /go/src/app/coredns /coredns EXPOSE 53 53/udp ENTRYPOINT ["/coredns"] From 3dff2e59d0142245f981f8a301b95b63cebceaf2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 21 Jan 2022 16:18:15 +0000 Subject: [PATCH 23/33] chore: update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 837cd925c18..b80a42502f6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ CoreDNS is a DNS server/forwarder, written in Go, that chains [plugins](https://coredns.io/plugins). Each plugin performs a (DNS) function. +This version has two plugin more than default named aaaa and retry. CoreDNS is a [Cloud Native Computing Foundation](https://cncf.io) graduated project. From ba3b3d22e75644f1ec58145e63c59f7b9bcbb678 Mon Sep 17 00:00:00 2001 From: yeganeahmadnejad Date: Fri, 21 Jan 2022 20:20:58 +0330 Subject: [PATCH 24/33] fix: ci workflow --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14616557f32..155ad0a72bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ name: ci on: push: branches: [ v1.8.6.1 ] + tags: [ v* ] pull_request: branches: [ v1.8.6.1 ] jobs: From 131b3ed1a60da9fc64cc64be146aed9b5c004f1f Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jan 2022 07:48:05 +0000 Subject: [PATCH 25/33] feat: update plugin chain to support retry for zonefile --- plugin.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.cfg b/plugin.cfg index e7d84a107b8..9279cf491fe 100644 --- a/plugin.cfg +++ b/plugin.cfg @@ -58,13 +58,13 @@ azure:azure clouddns:clouddns k8s_external:k8s_external kubernetes:kubernetes +retry:github.com/snapp-incubator/coredns-plugins/retry +fanout:github.com/snapp-incubator/fanout file:file auto:auto secondary:secondary etcd:etcd loop:loop -retry:github.com/snapp-incubator/coredns-plugins/retry -fanout:github.com/snapp-incubator/fanout forward:forward grpc:grpc erratic:erratic From 3fd502d324ae312a3dc47a593779b65a164821f0 Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 24 Jul 2022 20:00:20 +0430 Subject: [PATCH 26/33] fix --- plugin.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin.cfg b/plugin.cfg index cc8094c8d30..5b4e976f129 100644 --- a/plugin.cfg +++ b/plugin.cfg @@ -66,10 +66,9 @@ auto:auto secondary:secondary etcd:etcd loop:loop -retry:github.com/snapp-incubator/coredns-plugins/retry -fanout:github.com/snapp-incubator/fanout forward:forward grpc:grpc +https:github.com/snapp-incubator/coredns-plugins/https erratic:erratic whoami:whoami on:github.com/coredns/caddy/onevent From 60191977ae826560a056a8a6216c13d4740c593c Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 24 Jul 2022 20:01:59 +0430 Subject: [PATCH 27/33] fix --- .github/workflows/depsreview.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/workflows/depsreview.yml diff --git a/.github/workflows/depsreview.yml b/.github/workflows/depsreview.yml deleted file mode 100644 index 0707d68715a..00000000000 --- a/.github/workflows/depsreview.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Dependency Review' -on: [pull_request] - -permissions: - contents: read - -jobs: - dependency-review: - runs-on: ubuntu-latest - steps: - - name: 'Checkout Repository' - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b - - name: 'Dependency Review' - uses: actions/dependency-review-action@94145f3150bfabdc97540cbd5f7e926306ea7744 From 369ebbdab2e0322bd32043e6df83314f1d59b6aa Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 24 Jul 2022 20:03:29 +0430 Subject: [PATCH 28/33] fix ci --- .github/workflows/ci.yml | 6 +++--- .github/workflows/docker.yml | 29 ----------------------------- .github/workflows/stale.yml | 26 -------------------------- 3 files changed, 3 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 155ad0a72bd..cc4db17e754 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: ci on: push: - branches: [ v1.8.6.1 ] + branches: [ cloud ] tags: [ v* ] pull_request: - branches: [ v1.8.6.1 ] + branches: [ cloud ] jobs: test: name: test @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '^1.16.0' + go-version: '^1.17.0' - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - uses: codecov/codecov-action@v1 with: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 97742575a9a..00000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Docker Release - -on: - release: - types: [published] - workflow_dispatch: - inputs: - release: - description: "Release (e.g., v1.9.0)" - required: true - -permissions: - contents: read - -jobs: - docker-release: - runs-on: ubuntu-latest - env: - DOCKER_LOGIN: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - RELEASE: ${{ github.event.inputs.release || github.event.release.tag_name }} - steps: - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b - - name: Build Docker Images - run: make VERSION=${RELEASE:1} DOCKER=coredns -f Makefile.docker release - - name: Show Docker Images - run: docker images - - name: Publish Docker Images - run: make VERSION=${RELEASE:1} DOCKER=coredns -f Makefile.docker docker-push diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 5150e336f0f..00000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: 'Close Stale Issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - -permissions: - contents: read - -jobs: - stale: - permissions: - issues: write # for actions/stale to close stale issues - pull-requests: write # for actions/stale to close stale PRs - runs-on: ubuntu-latest - steps: - - uses: actions/stale@532554b8a8498a0e006fbcde824b048728c4178f - with: - stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days' - stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days' - days-before-stale: 30 - days-before-close: 7 - exempt-issue-labels: 'enhancement' - exempt-all-milestones: true - labels-to-remove-when-unstale: 'answered,needs info,needs update' - any-of-issue-labels: 'answered,needs info' - any-of-pr-labels: 'needs update,needs info' From 0317f1bbcd50504f51f081f1571ae46977d995d4 Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 24 Jul 2022 20:21:30 +0430 Subject: [PATCH 29/33] fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 87494d1ddee..4992ba162f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ #build stage -FROM golang:1.16 AS builder +FROM golang:1.17 AS builder RUN mkdir -p /go/src/app COPY go.sum go.mod /go/src/app/ WORKDIR /go/src/app From 3a0b2894c2bd05b2ecca35c3997b0057ad9bc5b1 Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 26 Nov 2023 02:41:16 +0330 Subject: [PATCH 30/33] fix --- .github/dependabot.yml | 6 ++-- .github/workflows/ci.yml | 2 +- .github/workflows/cifuzz.yml | 27 --------------- .github/workflows/release.yml | 55 ------------------------------ .github/workflows/scorecards.yml | 56 ------------------------------- .github/workflows/trivy-scan.yaml | 33 ------------------ 6 files changed, 4 insertions(+), 175 deletions(-) delete mode 100644 .github/workflows/cifuzz.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/scorecards.yml delete mode 100644 .github/workflows/trivy-scan.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 890eb28a54a..5058b9345d8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,12 +8,12 @@ updates: groups: dev-dependencies: patterns: - - "*" + - "*" - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" + interval: "monthly" groups: dev-dependencies: patterns: - - "*" + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc4db17e754..b58e3e628ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '^1.17.0' + go-version: '^1.20.0' - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - uses: codecov/codecov-action@v1 with: diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml deleted file mode 100644 index 1cc71736981..00000000000 --- a/.github/workflows/cifuzz.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: CIFuzz -on: - pull_request: - branches: - - master -jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master # cifuzz can't be pinned https://github.com/google/oss-fuzz/issues/6836 - with: - oss-fuzz-project-name: "go-coredns" - dry-run: false - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master # cifuzz can't be pinned - with: - oss-fuzz-project-name: "go-coredns" - fuzz-seconds: 600 - dry-run: false - - name: Upload Crash - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 26481291344..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - commit: - description: "Commit (e.g., 52f0348)" - default: "master" - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.commit }} - - name: Set up info - run: | - set -x -e - VERSION=$(make -f Makefile.release version) - COMMIT=$(git rev-parse --quiet --verify ${{ github.event.inputs.commit }}) - if [[ "$(git tag -l v${VERSION})" == "v${VERSION}" ]]; then - echo "v${VERSION} already released" - exit 1 - fi - echo "commit=${COMMIT}" >> $GITHUB_OUTPUT - echo "version=${VERSION}" >> $GITHUB_OUTPUT - id: info - - name: Build release binary - run: make -f Makefile.release release - - name: Build release binary sha256 - run: (cd release; for asset in `ls -A *tgz`; do sha256sum $asset > $asset.sha256; done) - - name: Remove hidden section - run: sed '/+++/,//d' notes/coredns-${{ steps.info.outputs.version}}.md > release.md - - name: Log release info - run: | - set -x -e - git log -1 - echo ${{ steps.info.outputs.commit }} - echo ${{ steps.info.outputs.version }} - cat release.md - sha256sum release/*.tgz - - name: Draft release - uses: softprops/action-gh-release@v1 - with: - body_path: release.md - name: v${{ steps.info.outputs.version }} - tag_name: v${{ steps.info.outputs.version }} - target_commitish: ${{ steps.info.outputs.commit }} - files: | - release/*.tgz - release/*.tgz.sha256 - draft: true diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index 19bc896c641..00000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Scorecards supply-chain security -on: - # Only the default branch is supported. - branch_protection_rule: - schedule: - - cron: '36 10 * * 3' - push: - branches: [ master ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - actions: read - contents: read - id-token: write - - steps: - - name: "Checkout code" - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 - with: - results_file: results.sarif - results_format: sarif - # Read-only PAT token. To create it, - # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. - repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} - # Publish the results to enable scorecard badges. For more details, see - # https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories, `publish_results` will automatically be set to `false`, - # regardless of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). - - name: "Upload artifact" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a - with: - sarif_file: results.sarif diff --git a/.github/workflows/trivy-scan.yaml b/.github/workflows/trivy-scan.yaml deleted file mode 100644 index 8dd7dfc8530..00000000000 --- a/.github/workflows/trivy-scan.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Trivy Nightly Scan -on: - schedule: - - cron: '0 2 * * 5' # Run at 2AM UTC on every Friday - -permissions: read-all -jobs: - nightly-scan: - name: Trivy Scan nightly - strategy: - fail-fast: false - matrix: - # It will test for only the latest version as older version is not maintained - versions: [latest] - permissions: - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@2b6a709cf9c4025c5438138008beaddbb02086f0 # master - with: - image-ref: 'docker.io/coredns/coredns:${{ matrix.versions }}' - severity: 'CRITICAL,HIGH' - format: 'sarif' - output: 'trivy-results.sarif' - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4 - with: - sarif_file: 'trivy-results.sarif' From e85b1f6ddb7a843dacf1d4d02823c6e2266075e7 Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 26 Nov 2023 02:42:19 +0330 Subject: [PATCH 31/33] remove yamllint --- .github/workflows/yamllint.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/yamllint.yml diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml deleted file mode 100644 index 918d56f33d4..00000000000 --- a/.github/workflows/yamllint.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Yamllint GitHub Actions' -on: - - pull_request -permissions: read-all -jobs: - yamllint: - name: 'Yamllint' - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@v4 - - name: 'Yamllint' - uses: karancode/yamllint-github-action@fdef6bc189425ecc84cc4543b2674566c0827053 - with: - yamllint_file_or_dir: '.' - yamllint_strict: false - yamllint_comment: true - env: - GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c2911f1e5da69ab3091ea2456c613948478f7b14 Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 26 Nov 2023 02:46:10 +0330 Subject: [PATCH 32/33] fix dockerfile --- Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a17adcfe58..d42f6b93a65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,9 +18,5 @@ COPY --from=slim /etc/ssl/certs /etc/ssl/certs WORKDIR / COPY --from=builder /go/src/app/coredns /coredns -FROM --platform=$TARGETPLATFORM ${BASE} -COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=build /coredns /coredns -USER nonroot:nonroot EXPOSE 53 53/udp ENTRYPOINT ["/coredns"] From bfb2d053b354feec5d5ea3391d08a7b7b8166ca4 Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor Date: Sun, 26 Nov 2023 02:47:05 +0330 Subject: [PATCH 33/33] fix branch --- .github/workflows/ci.yml | 4 ++-- plugin.cfg | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b58e3e628ca..5b5a9bd2b1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: ci on: push: - branches: [ cloud ] + branches: [ master ] tags: [ v* ] pull_request: - branches: [ cloud ] + branches: [ master ] jobs: test: name: test diff --git a/plugin.cfg b/plugin.cfg index ae42e3051a6..adff800272b 100644 --- a/plugin.cfg +++ b/plugin.cfg @@ -66,6 +66,7 @@ file:file auto:auto secondary:secondary etcd:etcd +etcdnx:github.com/snapp-incubator/coredns-plugins/etcdnx loop:loop forward:forward grpc:grpc