Skip to content

Commit

Permalink
Merge pull request #1265 from rajatchopra/releasev0.12
Browse files Browse the repository at this point in the history
Spruce up for release 12.0
  • Loading branch information
rajatchopra authored Mar 12, 2020
2 parents cebcfea + bd3f2c0 commit 4ff77dc
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
20 changes: 10 additions & 10 deletions Documentation/kube-flannel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ spec:
serviceAccountName: flannel
initContainers:
- name: install-cni
image: quay.io/coreos/flannel:v0.11.0-amd64
image: quay.io/coreos/flannel:v0.12.0-amd64
command:
- cp
args:
Expand All @@ -183,7 +183,7 @@ spec:
mountPath: /etc/kube-flannel/
containers:
- name: kube-flannel
image: quay.io/coreos/flannel:v0.11.0-amd64
image: quay.io/coreos/flannel:v0.12.0-amd64
command:
- /opt/bin/flanneld
args:
Expand Down Expand Up @@ -263,7 +263,7 @@ spec:
serviceAccountName: flannel
initContainers:
- name: install-cni
image: quay.io/coreos/flannel:v0.11.0-arm64
image: quay.io/coreos/flannel:v0.12.0-arm64
command:
- cp
args:
Expand All @@ -277,7 +277,7 @@ spec:
mountPath: /etc/kube-flannel/
containers:
- name: kube-flannel
image: quay.io/coreos/flannel:v0.11.0-arm64
image: quay.io/coreos/flannel:v0.12.0-arm64
command:
- /opt/bin/flanneld
args:
Expand Down Expand Up @@ -357,7 +357,7 @@ spec:
serviceAccountName: flannel
initContainers:
- name: install-cni
image: quay.io/coreos/flannel:v0.11.0-arm
image: quay.io/coreos/flannel:v0.12.0-arm
command:
- cp
args:
Expand All @@ -371,7 +371,7 @@ spec:
mountPath: /etc/kube-flannel/
containers:
- name: kube-flannel
image: quay.io/coreos/flannel:v0.11.0-arm
image: quay.io/coreos/flannel:v0.12.0-arm
command:
- /opt/bin/flanneld
args:
Expand Down Expand Up @@ -451,7 +451,7 @@ spec:
serviceAccountName: flannel
initContainers:
- name: install-cni
image: quay.io/coreos/flannel:v0.11.0-ppc64le
image: quay.io/coreos/flannel:v0.12.0-ppc64le
command:
- cp
args:
Expand All @@ -465,7 +465,7 @@ spec:
mountPath: /etc/kube-flannel/
containers:
- name: kube-flannel
image: quay.io/coreos/flannel:v0.11.0-ppc64le
image: quay.io/coreos/flannel:v0.12.0-ppc64le
command:
- /opt/bin/flanneld
args:
Expand Down Expand Up @@ -545,7 +545,7 @@ spec:
serviceAccountName: flannel
initContainers:
- name: install-cni
image: quay.io/coreos/flannel:v0.11.0-s390x
image: quay.io/coreos/flannel:v0.12.0-s390x
command:
- cp
args:
Expand All @@ -559,7 +559,7 @@ spec:
mountPath: /etc/kube-flannel/
containers:
- name: kube-flannel
image: quay.io/coreos/flannel:v0.11.0-s390x
image: quay.io/coreos/flannel:v0.12.0-s390x
command:
- /opt/bin/flanneld
args:
Expand Down
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dist/flanneld.exe: $(shell find . -type f -name '*.go')
# This will build flannel natively using golang image
dist/flanneld-$(ARCH): dist/qemu-$(ARCH)-static
# valid values for ARCH are [amd64 arm arm64 ppc64le s390x]
docker run -e CGO_ENABLED=$(CGO_ENABLED) -e GOARCH=$(ARCH) \
docker run -e CGO_ENABLED=$(CGO_ENABLED) -e GOARCH=$(ARCH) -e GOCACHE=/go \
-u $(shell id -u):$(shell id -g) \
-v $(CURDIR)/dist/qemu-$(ARCH)-static:/usr/bin/qemu-$(ARCH)-static \
-v $(CURDIR):/go/src/github.com/coreos/flannel:ro \
Expand Down Expand Up @@ -129,7 +129,7 @@ ifneq ($(ARCH),amd64)
$(MAKE) dist/qemu-$(ARCH)-static
endif
# valid values for ARCH are [amd64 arm arm64 ppc64le s390x]
docker run -e GOARM=$(GOARM) \
docker run -e GOARM=$(GOARM) -e GOCACHE=/go \
-u $(shell id -u):$(shell id -g) \
-v $(CURDIR):/go/src/github.com/coreos/flannel:ro \
-v $(CURDIR)/dist:/go/src/github.com/coreos/flannel/dist \
Expand Down Expand Up @@ -181,19 +181,23 @@ tar.gz:
tar --transform='flags=r;s|-s390x||' -zcvf dist/flannel-$(TAG)-linux-s390x.tar.gz -C dist flanneld-s390x mk-docker-opts.sh ../README.md
tar -tvf dist/flannel-$(TAG)-linux-s390x.tar.gz

release-tests: bash_unit
release-tests: release-etcd-tests release-k8s-tests

release-etcd-tests: bash_unit
# Run the functional tests with different etcd versions.
ETCD_IMG="quay.io/coreos/etcd:latest" ./bash_unit dist/functional-test.sh
ETCD_IMG="quay.io/coreos/etcd:v3.2.7" ./bash_unit dist/functional-test.sh
ETCD_IMG="quay.io/coreos/etcd:v3.1.10" ./bash_unit dist/functional-test.sh
ETCD_IMG="quay.io/coreos/etcd:v3.0.17" ./bash_unit dist/functional-test.sh
# Etcd v2 docker image format is different. Override the etcd binary location so it works.
ETCD_IMG="quay.io/coreos/etcd:v2.3.8" ETCD_LOCATION=" " ./bash_unit dist/functional-test.sh

release-k8s-tests: bash_unit
# Run the functional tests with different k8s versions. Currently these are the latest point releases.
# This list should be updated during the release process.
K8S_VERSION="1.7.6" ./bash_unit dist/functional-test-k8s.sh
K8S_VERSION="1.6.10" ./bash_unit dist/functional-test-k8s.sh
K8S_VERSION="1.17.3" HYPERKUBE_CMD=" " HYPERKUBE_APISERVER_CMD="kube-apiserver" ./bash_unit dist/functional-test-k8s.sh
K8S_VERSION="1.16.7" HYPERKUBE_CMD=" " HYPERKUBE_APISERVER_CMD="kube-apiserver" ./bash_unit dist/functional-test-k8s.sh
K8S_VERSION="1.15.10" HYPERKUBE_CMD=" " HYPERKUBE_APISERVER_CMD="kube-apiserver" ./bash_unit dist/functional-test-k8s.sh
# K8S_VERSION="1.7.6" ./bash_unit dist/functional-test-k8s.sh
# K8S_VERSION="1.6.10" ./bash_unit dist/functional-test-k8s.sh
# K8S_VERSION="1.5.7" ./bash_unit dist/functional-test-k8s.sh #kube-flannel.yml is incompatible
# K8S_VERSION="1.4.12" ./bash_unit dist/functional-test-k8s.sh #kube-flannel.yml is incompatible
# K8S_VERSION="1.3.10" ./bash_unit dist/functional-test-k8s.sh #kube-flannel.yml is incompatible
Expand Down
10 changes: 6 additions & 4 deletions dist/functional-test-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ TAG=`git describe --tags --dirty`
FLANNEL_DOCKER_IMAGE="${FLANNEL_DOCKER_IMAGE:-quay.io/coreos/flannel:$TAG}"
K8S_VERSION="${K8S_VERSION:-1.13.2}"
HYPERKUBE_IMG="gcr.io/google_containers/hyperkube-${ARCH}"
HYPERKUBE_CMD="${HYPERKUBE_CMD:-/hyperkube}"
HYPERKUBE_APISERVER_CMD="${HYPERKUBE_APISERVER_CMD:-apiserver}"

docker_ip=$(ip -o -f inet addr show docker0 | grep -Po 'inet \K[\d.]+')
etcd_endpt="http://$docker_ip:2379"
Expand All @@ -31,11 +33,11 @@ setup_suite() {
# Start a kubernetes API server
docker rm -f flannel-e2e-k8s-apiserver >/dev/null 2>/dev/null
docker run -d --net=host --name flannel-e2e-k8s-apiserver ${HYPERKUBE_IMG}:v$K8S_VERSION \
/hyperkube apiserver --etcd-servers=$etcd_endpt \
${HYPERKUBE_CMD} ${HYPERKUBE_APISERVER_CMD} --etcd-servers=$etcd_endpt \
--service-cluster-ip-range=10.101.0.0/16 --insecure-bind-address=0.0.0.0 --allow-privileged >/dev/null
sleep 1

while ! cat <<EOF | docker run -i --rm --net=host ${HYPERKUBE_IMG}:v$K8S_VERSION /hyperkube kubectl create -f - >/dev/null 2>/dev/null
while ! cat <<EOF | docker run -i --rm --net=host ${HYPERKUBE_IMG}:v$K8S_VERSION ${HYPERKUBE_CMD} kubectl create -f - >/dev/null 2>/dev/null
apiVersion: v1
kind: Node
metadata:
Expand All @@ -49,7 +51,7 @@ do
sleep 1
done

cat <<EOF | docker run -i --rm --net=host ${HYPERKUBE_IMG}:v$K8S_VERSION /hyperkube kubectl create -f - >/dev/null 2>/dev/null
cat <<EOF | docker run -i --rm --net=host ${HYPERKUBE_IMG}:v$K8S_VERSION ${HYPERKUBE_CMD} kubectl create -f - >/dev/null 2>/dev/null
apiVersion: v1
kind: Node
metadata:
Expand Down Expand Up @@ -148,5 +150,5 @@ pings() {

test_manifest() {
# This just tests that the API server accepts the manifest, not that it actually acts on it correctly.
assert "cat ../Documentation/kube-flannel.yml | docker run -i --rm --net=host ${HYPERKUBE_IMG}:v$K8S_VERSION /hyperkube kubectl create -f -"
assert "cat ../Documentation/kube-flannel.yml | docker run -i --rm --net=host ${HYPERKUBE_IMG}:v$K8S_VERSION ${HYPERKUBE_CMD} kubectl create -f -"
}
2 changes: 1 addition & 1 deletion dist/functional-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ setup_suite() {

# Start etcd
docker rm -f flannel-e2e-test-etcd >/dev/null 2>/dev/null
docker run --name=flannel-e2e-test-etcd -d -p 2379:2379 $ETCD_IMG $ETCD_LOCATION --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls $etcd_endpt >/dev/null
docker run --name=flannel-e2e-test-etcd -d --dns 8.8.8.8 -p 2379:2379 $ETCD_IMG $ETCD_LOCATION --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls $etcd_endpt >/dev/null
}

teardown_suite() {
Expand Down
4 changes: 2 additions & 2 deletions subnet/etcdv2/mock_etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (me *mockEtcd) set(ctx context.Context, key, value string, opts *etcd.SetOp

if node != nil {
if opts.PrevIndex > 0 && opts.PrevIndex < node.ModifiedIndex {
return nil, me.newError(etcd.ErrorCodeTestFailed, "Key %s PrevIndex %s less than node ModifiedIndex %d", key, opts.PrevIndex, node.ModifiedIndex)
return nil, me.newError(etcd.ErrorCodeTestFailed, "Key %s PrevIndex %v less than node ModifiedIndex %d", key, opts.PrevIndex, node.ModifiedIndex)
}

if opts.Dir != node.Dir {
Expand Down Expand Up @@ -342,7 +342,7 @@ func (me *mockEtcd) Delete(ctx context.Context, key string, opts *etcd.DeleteOpt
}

if opts.PrevIndex > 0 && opts.PrevIndex < node.ModifiedIndex {
return nil, me.newError(etcd.ErrorCodeTestFailed, "Key %s PrevIndex %s less than node ModifiedIndex %d", key, opts.PrevIndex, node.ModifiedIndex)
return nil, me.newError(etcd.ErrorCodeTestFailed, "Key %s PrevIndex %v less than node ModifiedIndex %d", key, opts.PrevIndex, node.ModifiedIndex)
}

if opts.PrevValue != "" && opts.PrevValue != node.Value {
Expand Down

0 comments on commit 4ff77dc

Please sign in to comment.