Skip to content

Commit

Permalink
Merge pull request #60 from rfredette/rebase-1.8.4
Browse files Browse the repository at this point in the history
NE-581: Rebase to upstream v1.8.4
  • Loading branch information
openshift-merge-robot authored Jun 28, 2021
2 parents c827018 + 1bce8b2 commit d73df8c
Show file tree
Hide file tree
Showing 1,013 changed files with 56,027 additions and 42,378 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
name: Run Kubernetes tests
command: |
cd ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci/test/kubernetes
go mod download
go test -v ./...
workflows:
Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ about: A question related to CoreDNS
labels: question

---
<!-- Please only use this template for submitting a generic question -->
<!--
Please only use this template for submitting a generic question.
Or consider using a GitHub discussion https://github.com/coredns/coredns/discussions
-->
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ When in doubt push forward and go public ASAP.

- the Fix Team will selectively choose all needed commits from the Master branch in order to create a new release on top of the current last version released.
- Release process will be as usual.
- The Fix Lead will request a CVE from [DWF](https://github.com/distributedweaknessfiling/DWF-Documentation)
- The Fix Lead will request a CVE from [DWF](https://github.com/distributedweaknessfiling/cvelist)
and include the CVSS and release details.
- The Fix Lead will inform all users, devs and integrators, now that everything is public,
announcing the new releases, the CVE number, and the relevant merged PRs to get wide distribution
Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
4 changes: 1 addition & 3 deletions .github/workflows/go.coverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Go Coverage
on: [push, pull_request]
on: [pull_request]
jobs:
test:
name: Coverage
Expand All @@ -8,8 +8,6 @@ jobs:

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15
id: go

- name: Check out code
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/go.fmt.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Go Fmt

on:
push:
branches:
- 'master'
paths:
- '**.go'
schedule:
- cron: '22 10 * * 1'

jobs:
fix:
Expand All @@ -23,14 +20,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "coredns-auto-go-fmt[bot]"
git config user.email "coredns-auto-go-fmt[bot]@users.noreply.github.com"
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 -m 'auto go fmt'
git commit -s -m 'auto go fmt'
git push
fi
23 changes: 16 additions & 7 deletions .github/workflows/go.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15
id: go

- name: Check out code
Expand All @@ -31,8 +29,6 @@ jobs:

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15
id: go

- name: Check out code
Expand All @@ -51,8 +47,6 @@ jobs:

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15
id: go

- name: Check out code
Expand All @@ -63,5 +57,20 @@ jobs:

- name: Test
run: |
go install github.com/fatih/faillint
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
run: make DOCKER=bla GITHUB_ACCESS_TOKEN=bla -n build docker github-push docker-push -f Makefile.release
15 changes: 5 additions & 10 deletions .github/workflows/go.tidy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: Go Tidy

on:
push:
branches:
- 'master'
paths:
- '.github/workflows/go.tidy.yml'
- 'go.mod'
- 'go.sum'
schedule:
- cron: '22 10 * * 3'

jobs:
fix:
Expand All @@ -26,14 +21,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "coredns-auto-go-mod-tidy[bot]"
git config user.email "coredns-auto-go-mod-tidy[bot]@users.noreply.github.com"
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 -m 'auto go mod tidy'
git commit -s -m 'auto go mod tidy'
git push
fi
18 changes: 5 additions & 13 deletions .github/workflows/make.doc.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
name: Make Doc

on:
push:
branches:
- 'master'
paths:
- '.github/workflows/make.doc.yml'
- 'coredns.1.md'
- 'corefile.5.md'
- 'plugin/*/README.md'
schedule:
- cron: '22 10 * * 0'

jobs:
fix:
Expand All @@ -20,8 +14,6 @@ jobs:
-
name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.1'
-
name: Update Docs
run: |
Expand All @@ -32,14 +24,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "coredns-auto-go-mod-tidy[bot]"
git config user.email "coredns-auto-go-mod-tidy[bot]@users.noreply.github.com"
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 -m 'auto make -f Makefile.doc'
git commit -s -m 'auto make -f Makefile.doc'
git push
fi
13 changes: 5 additions & 8 deletions .github/workflows/whitespace.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Remove Trailing Whitespaces

on:
push:
branches:
- 'master'
paths-ignore:
- '**.go'
schedule:
- cron: '22 10 * * 2'

jobs:
fix:
Expand All @@ -23,14 +20,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "coredns-auto-trailing-whitespaces[bot]"
git config user.email "coredns-auto-trailing-whitespaces[bot]@users.noreply.github.com"
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 -m 'auto remove trailing whitespaces'
git commit -s -m 'auto remove trailing whitespaces'
git push
fi
4 changes: 3 additions & 1 deletion ADOPTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* [AdGuard](https://adguard.com/) uses CoreDNS in [AdGuard Home](https://github.com/AdguardTeam/AdGuardHome) and, therefore, in production public AdGuard DNS servers.
* [Skyscanner](https://www.skyscanner.net) uses CoreDNS within Kubernetes in production with the configuration tuned to use the Autopath plugin.
* [Zinza Technology](https://zinza.com.vn) uses CoreDNS within Kubernetes in production, with standard configuration.
* [Hualala](https://www.hualala.com/home) uses CoreDNS in Kubernetes using default configuration, in its Lab. Expected to be in production soon.
* [Hualala](https://www.hualala.com) uses CoreDNS in Kubernetes using default configuration, in its Lab. Expected to be in production soon.
* [Hellofresh](https://www.hellofresh.com/) uses CoreDNS in multiple Kubernetes clusters, with Forward plugin.
* [Render](https://render.com) uses CoreDNS in production across all its Kubernetes clusters.
* [BackMarket](https://www.backmarket.com) uses CoreDNS within Kubernetes in production, with standard configuration.
* [Absa Group](https://www.absa.africa) uses CoreDNS as an integral part of Kubernetes Global Balancer project - [k8gb](https://www.k8gb.io/).
53 changes: 36 additions & 17 deletions Makefile.release
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Steps to release, first:
#
# 1. Up the version in coremain/version.go
# 2. Do a make -f Makefile.doc
# 2. Do a make -f Makefile.doc # This has been automated in GitHub, so you can probably skip this step
# 3. go generate
# 4. Send PR to get this merged.
#
Expand All @@ -39,6 +39,14 @@
# * make docker
# * make github-push
# * make docker-push
#
# Testing this is hard-ish as you don't want to accidentially release a coredns. If not executing the github-push target
# and using a non-coredns docker repo you should be fine.
# Testing docker is done e.g. via:
#
# export DOCKER_PASSWORD=<pass>
# export DOCKER_LOGIN=miek
# make DOCKER=miek -f Makefile.release build docker-build docker-push

EMPTY:=
SPACE:=$(EMPTY) $(EMPTY)
Expand All @@ -47,18 +55,18 @@ COMMA:=$(EMPTY),$(EMPTY)
ifeq (, $(shell which curl))
$(error "No curl in $$PATH, please install")
endif
ifeq (, $(shell which manifest-tool))
$(error "No manifest-tool in $$PATH, please install")
endif

# DOCKER is the docker image repo we need to push to.
DOCKER:=
NAME:=coredns
VERSION:=$(shell grep 'CoreVersion' coremain/version.go | awk '{ print $$3 }' | tr -d '"')
GITHUB:=coredns
# mips is not in LINUX_ARCH because it's not supported by docker manifest
LINUX_ARCH:=amd64 arm arm64 mips64le ppc64le s390x
DOCKER_IMAGE_NAME:=$(DOCKER)/$(NAME)
# mips is not in LINUX_ARCH because it's not supported by the manifest-tool.
LINUX_ARCH:=amd64 arm arm64 ppc64le s390x
PLATFORMS:=$(subst $(SPACE),$(COMMA),$(foreach arch,$(LINUX_ARCH),linux/$(arch)))
DOCKER_IMAGE_LIST_VERSIONED:=$(shell echo $(LINUX_ARCH) | sed -e "s~[^ ]*~$(DOCKER_IMAGE_NAME)\-&:$(VERSION)~g")
DOCKER_IMAGE_LIST_LATEST:=$(shell echo $(LINUX_ARCH) | sed -e "s~[^ ]*~$(DOCKER_IMAGE_NAME)\-&:latest~g")

all:
@echo Use the 'release' target to build a release, 'docker' for docker build.
Expand All @@ -69,6 +77,7 @@ docker: docker-build

.PHONY: build
build:
@go version
@echo Cleaning old builds
@rm -rf build && mkdir build
@echo Building: darwin/amd64 - $(VERSION)
Expand All @@ -77,8 +86,6 @@ build:
mkdir -p build/windows/amd64 && $(MAKE) coredns BINARY=build/windows/amd64/$(NAME).exe SYSTEM="GOOS=windows GOARCH=amd64" CHECKS="" BUILDOPTS=""
@echo Building: linux/mips - $(VERSION)
mkdir -p build/linux/mips && $(MAKE) coredns BINARY=build/linux/mips/$(NAME) SYSTEM="GOOS=linux GOARCH=mips" CHECKS="" BUILDOPTS=""
@echo Building: linux/mips64le - $(VERSION)
mkdir -p build/linux/mips64le && $(MAKE) coredns BINARY=build/linux/mips64le/$(NAME) SYSTEM="GOOS=linux GOARCH=mips64le" CHECKS="" BUILDOPTS=""
@echo Building: linux/$(LINUX_ARCH) - $(VERSION) ;\
for arch in $(LINUX_ARCH); do \
mkdir -p build/linux/$$arch && $(MAKE) coredns BINARY=build/linux/$$arch/$(NAME) SYSTEM="GOOS=linux GOARCH=$$arch" CHECKS="" BUILDOPTS="" ;\
Expand Down Expand Up @@ -135,11 +142,11 @@ else
@# 2. Copy Dockerfile to build/docker/linux/<arch>
@rm -rf build/docker
for arch in $(LINUX_ARCH); do \
mkdir -p build/docker/linux/$$arch ;\
tar -xzf release/$(NAME)_$(VERSION)_linux_$$arch.tgz -C build/docker/linux/$$arch ;\
cp Dockerfile build/docker/linux/$$arch ;\
docker build -t coredns build/docker/linux/$$arch ;\
docker tag coredns $(DOCKER_IMAGE_NAME):coredns-$$arch ;\
mkdir -p build/docker/linux/$${arch} ;\
tar -xzf release/$(NAME)_$(VERSION)_linux_$${arch}.tgz -C build/docker/linux/$${arch} ;\
cp Dockerfile build/docker/linux/$${arch} ;\
docker build -t $(DOCKER_IMAGE_NAME)-$${arch}:$(VERSION) build/docker/linux/$${arch} ;\
docker tag $(DOCKER_IMAGE_NAME)-$${arch}:$(VERSION) $(DOCKER_IMAGE_NAME)-$${arch}:latest ;\
done
endif

Expand All @@ -148,13 +155,25 @@ docker-push:
ifeq ($(DOCKER),)
$(error "Please specify Docker registry to use. Use DOCKER=coredns for releases")
else
@# Experimental CLI is required for docker manifest to work
@# Pushes coredns/coredns-$arch:$version images
@# Creates manifest for multi-arch image
@# Pushes multi-arch image to coredns/coredns:$version
export DOCKER_CLI_EXPERIMENTAL=enabled
@echo $(DOCKER_PASSWORD) | docker login -u $(DOCKER_LOGIN) --password-stdin
@echo Pushing: $(VERSION) to $(DOCKER_IMAGE_NAME)
for arch in $(LINUX_ARCH); do \
docker push $(DOCKER_IMAGE_NAME):coredns-$$arch ;\
docker push $(DOCKER_IMAGE_NAME)-$${arch}:$(VERSION) ;\
docker push $(DOCKER_IMAGE_NAME)-$${arch}:latest ;\
done
docker manifest create --amend $(DOCKER_IMAGE_NAME):$(VERSION) $(DOCKER_IMAGE_LIST_VERSIONED)
docker manifest create --amend $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_LIST_LATEST)
for arch in $(LINUX_ARCH); do \
docker manifest annotate --arch $${arch} $(DOCKER_IMAGE_NAME):$(VERSION) $(DOCKER_IMAGE_NAME)-$${arch}:$(VERSION) ;\
docker manifest annotate --arch $${arch} $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME)-$${arch}:latest ;\
done
manifest-tool push from-args --platforms $(PLATFORMS) --template $(DOCKER_IMAGE_NAME):coredns-ARCH --target $(DOCKER_IMAGE_NAME):$(VERSION)
manifest-tool push from-args --platforms $(PLATFORMS) --template $(DOCKER_IMAGE_NAME):coredns-ARCH --target $(DOCKER_IMAGE_NAME):latest
docker manifest push --purge $(DOCKER_IMAGE_NAME):$(VERSION)
docker manifest push --purge $(DOCKER_IMAGE_NAME):latest
endif

.PHONY: version
Expand Down Expand Up @@ -184,5 +203,5 @@ prs:
authors:
@echo "## Brought to You By"
@echo
@git log --pretty=format:'%an' $$(git describe --tags --abbrev=0)..master | sort -u | grep -v '^coredns-auto' | grep -v '^dependabot-preview' | \
@git log --pretty=format:'%an' $$(git describe --tags --abbrev=0)..master | sort -u | grep -v '^coredns-auto' | grep -v '^coredns\[bot\]' | grep -v '^dependabot-preview' | \
tac | cat -n | sed -e 's/^[[:space:]]\+1[[:space:]]\+\(.*\)/\1./' | sed -e 's/^[[:space:]]\+[[:digit:]]\+[[:space:]]\+\(.*\)/\1,/' | tac # comma separate, with dot at the end
Loading

0 comments on commit d73df8c

Please sign in to comment.