Quellcode durchsuchen

Merge pull request #1265 from rajatchopra/releasev0.12

Spruce up for release 12.0
Rajat Chopra vor 5 Jahren
Ursprung
Commit
4ff77dc7c3
5 geänderte Dateien mit 30 neuen und 24 gelöschten Zeilen
  1. 10 10
      Documentation/kube-flannel.yml
  2. 11 7
      Makefile
  3. 6 4
      dist/functional-test-k8s.sh
  4. 1 1
      dist/functional-test.sh
  5. 2 2
      subnet/etcdv2/mock_etcd.go

+ 10 - 10
Documentation/kube-flannel.yml

@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:
@@ -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:

+ 11 - 7
Makefile

@@ -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 \
@@ -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 \
@@ -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

+ 6 - 4
dist/functional-test-k8s.sh

@@ -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"
@@ -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:
@@ -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:
@@ -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 -"
 }

+ 1 - 1
dist/functional-test.sh

@@ -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() {

+ 2 - 2
subnet/etcdv2/mock_etcd.go

@@ -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 {
@@ -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 {