From 9a9894e9efe812550412feac7645e24b5e06bffe Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Oct 22 2015 09:31:43 +0000 Subject: Update to v0.5.4 - resolves: #1273211 --- diff --git a/.gitignore b/.gitignore index 69b16f0..2dcceae 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/flannel-29ffccc.tar.gz +/flannel-84dd9b0.tar.gz diff --git a/Notify-systemd-service-when-server-is-ready-to-liste.patch b/Notify-systemd-service-when-server-is-ready-to-liste.patch deleted file mode 100644 index 22655a3..0000000 --- a/Notify-systemd-service-when-server-is-ready-to-liste.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c623d5666ef076de1b79c7b86d72a9d68847f672 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Wed, 23 Sep 2015 09:40:46 +0200 -Subject: [PATCH] Notify systemd service when server is ready to listen - ---- - remote/server.go | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/remote/server.go b/remote/server.go -index a39f80c..6d6fb05 100644 ---- a/remote/server.go -+++ b/remote/server.go -@@ -26,6 +26,7 @@ import ( - - "github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/etcd/pkg/transport" - "github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-systemd/activation" -+ "github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-systemd/daemon" - log "github.com/coreos/flannel/Godeps/_workspace/src/github.com/golang/glog" - "github.com/coreos/flannel/Godeps/_workspace/src/github.com/gorilla/mux" - "github.com/coreos/flannel/Godeps/_workspace/src/golang.org/x/net/context" -@@ -276,6 +277,8 @@ func RunServer(ctx context.Context, sm subnet.Manager, listenAddr, cafile, certf - c <- http.Serve(l, httpLogger(r)) - }() - -+ daemon.SdNotify("READY=1") -+ - select { - case <-ctx.Done(): - l.Close() --- -1.9.3 - diff --git a/flannel.spec b/flannel.spec index 434de3b..1d03089 100644 --- a/flannel.spec +++ b/flannel.spec @@ -3,36 +3,39 @@ %global with_bundled 0 %global with_debug 1 %global with_check 1 +%global with_unit_test 1 %else %global with_devel 0 %global with_bundled 1 %global with_debug 0 %global with_check 0 +%global with_unit_test 0 %endif %if 0%{?with_debug} -# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 %global _dwz_low_mem_die_limit 0 %else %global debug_package %{nil} %endif + %global provider github %global provider_tld com %global project coreos %global repo flannel -%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} -%global commit 29ffccc484cd46b6bc2d5a5b9d23e3e2f3f2851c +%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} +%global import_path %{provider_prefix} +%global commit 84dd9b08366d7e18a8d11c7bce376177b53c1ea5 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global devel_main flannel-devel Name: flannel -Version: 0.5.3 -Release: 6%{?dist} +Version: 0.5.4 +Release: 1%{?dist} Summary: Etcd address management agent for overlay networks License: ASL 2.0 -URL: https://%{import_path} -Source0: https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz +URL: https://%{provider_prefix} +Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz #Source0: https://%{import_path}/archive/v%{version}.tar.gz Source1: flanneld.sysconf Source2: flanneld.service @@ -41,7 +44,6 @@ Source4: flannel-tmpfiles.conf Patch0: change-4001-to-2379-in-help-and-README.patch Patch1: change-coreos.com-network-to-atomic.io-network-in-he.patch -Patch2: Notify-systemd-service-when-server-is-ready-to-liste.patch ExclusiveArch: %{ix86} x86_64 %{arm} @@ -50,6 +52,10 @@ BuildRequires: golang >= 1.2.7 BuildRequires: golang(code.google.com/p/goauth2/compute/serviceaccount) BuildRequires: golang(code.google.com/p/google-api-go-client/compute/v1) BuildRequires: golang(code.google.com/p/google-api-go-client/googleapi) +BuildRequires: golang(github.com/aws/aws-sdk-go/aws) +BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr) +BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata) +BuildRequires: golang(github.com/aws/aws-sdk-go/service/ec2) BuildRequires: golang(github.com/coreos/etcd/client) BuildRequires: golang(github.com/coreos/etcd/pkg/transport) BuildRequires: golang(github.com/coreos/go-iptables/iptables) @@ -58,8 +64,6 @@ BuildRequires: golang(github.com/coreos/go-systemd/daemon) >= 2-2 BuildRequires: golang(github.com/coreos/pkg/flagutil) BuildRequires: golang(github.com/golang/glog) BuildRequires: golang(github.com/gorilla/mux) -BuildRequires: golang(github.com/mitchellh/goamz/aws) -BuildRequires: golang(github.com/mitchellh/goamz/ec2) BuildRequires: golang(github.com/vishvananda/netlink) BuildRequires: golang(github.com/vishvananda/netlink/nl) BuildRequires: golang(golang.org/x/net/context) @@ -77,35 +81,43 @@ that need to communicate with one another. %if 0%{?with_devel} %package devel -Summary: %{summary} -BuildRequires: golang >= 1.2.7 +Summary: %{summary} +BuildArch: noarch +%if 0%{?with_check} BuildRequires: golang(code.google.com/p/goauth2/compute/serviceaccount) BuildRequires: golang(code.google.com/p/google-api-go-client/compute/v1) BuildRequires: golang(code.google.com/p/google-api-go-client/googleapi) +BuildRequires: golang(github.com/aws/aws-sdk-go/aws) +BuildRequires: golang(github.com/aws/aws-sdk-go/aws/awserr) +BuildRequires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata) +BuildRequires: golang(github.com/aws/aws-sdk-go/service/ec2) BuildRequires: golang(github.com/coreos/etcd/client) BuildRequires: golang(github.com/coreos/etcd/pkg/transport) BuildRequires: golang(github.com/coreos/go-iptables/iptables) BuildRequires: golang(github.com/coreos/go-systemd/activation) +BuildRequires: golang(github.com/coreos/go-systemd/daemon) BuildRequires: golang(github.com/golang/glog) BuildRequires: golang(github.com/gorilla/mux) -BuildRequires: golang(github.com/mitchellh/goamz/aws) -BuildRequires: golang(github.com/mitchellh/goamz/ec2) BuildRequires: golang(github.com/vishvananda/netlink) BuildRequires: golang(github.com/vishvananda/netlink/nl) BuildRequires: golang(golang.org/x/net/context) +%endif Requires: golang(code.google.com/p/goauth2/compute/serviceaccount) Requires: golang(code.google.com/p/google-api-go-client/compute/v1) Requires: golang(code.google.com/p/google-api-go-client/googleapi) +Requires: golang(github.com/aws/aws-sdk-go/aws) +Requires: golang(github.com/aws/aws-sdk-go/aws/awserr) +Requires: golang(github.com/aws/aws-sdk-go/aws/ec2metadata) +Requires: golang(github.com/aws/aws-sdk-go/service/ec2) Requires: golang(github.com/coreos/etcd/client) Requires: golang(github.com/coreos/etcd/pkg/transport) Requires: golang(github.com/coreos/go-iptables/iptables) Requires: golang(github.com/coreos/go-systemd/activation) +Requires: golang(github.com/coreos/go-systemd/daemon) Requires: golang(github.com/golang/glog) Requires: golang(github.com/gorilla/mux) -Requires: golang(github.com/mitchellh/goamz/aws) -Requires: golang(github.com/mitchellh/goamz/ec2) Requires: golang(github.com/vishvananda/netlink) Requires: golang(github.com/vishvananda/netlink/nl) Requires: golang(golang.org/x/net/context) @@ -131,40 +143,49 @@ This package contains library source intended for building other packages which use %{project}/%{repo}. %endif +%if 0%{?with_unit_test} && 0%{?with_devel} +%package unit-test-devel +Summary: Unit tests for %{name} package +%if 0%{?with_check} +#Here comes all BuildRequires: PACKAGE the unit tests +#in %%check section need for running +%endif + +# test subpackage tests code from devel subpackage +Requires: %{name}-devel = %{version}-%{release} + +%description unit-test-devel +%{summary} + +This package contains unit tests for project +providing packages with %{import_path} prefix. +%endif + %prep %setup -q -n %{repo}-%{commit} %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%if ! 0%{?with_bundled} find . -name "*.go" \ -print |\ xargs sed -i 's/github.com\/coreos\/flannel\/Godeps\/_workspace\/src\///g' -%endif %build -%if ! 0%{?with_bundled} -rm -rf Godeps -mkdir _build -pushd _build - mkdir -p src/github.com/coreos - ln -s $(dirs +1 -l) src/github.com/coreos/flannel -popd +mkdir -p src/github.com/coreos +ln -s ../../../ src/github.com/coreos/flannel -%if 0%{?with_debug} -function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; } +%if ! 0%{?with_bundled} +export GOPATH=$(pwd):%{gopath} %else -function gobuild { go build -a -v -x "$@"; } +export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath} %endif -mkdir bin -export GOPATH=${PWD}/_build:%{gopath} -gobuild -o bin/flanneld . -%else -./build +%if ! 0%{?gobuild:1} +%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; %endif +%gobuild -o bin/flanneld %{import_path} + %install # package with binary install -D -p -m 755 bin/flanneld %{buildroot}%{_bindir}/flanneld @@ -178,17 +199,48 @@ mkdir -p %{buildroot}/run install -d -m 0755 %{buildroot}/run/%{name}/ %if 0%{?with_devel} -# devel package install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -cp -pav {backend,pkg,subnet} %{buildroot}/%{gopath}/src/%{import_path}/ +echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list +# find all *.go but no *_test.go files and generate devel.file-list +for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list + install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) + cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file + echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list +done +%endif + +# testing files for this project +%if 0%{?with_unit_test} && 0%{?with_devel} +install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ +# find all *_test.go files and generate unit-test.file-list +for file in $(find . -iname "*_test.go"); do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list + install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) + cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file + echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list +done +%endif + +%if 0%{?with_devel} +sort -u -o devel.file-list devel.file-list %endif %check -%if 0%{?with_check} -export GOPATH=${PWD}/_build:%{gopath} -go test %{import_path}/pkg/ip -#go test %{import_path}/remote -go test %{import_path}/subnet +%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} +%if ! 0%{?with_bundled} +export GOPATH=%{buildroot}/%{gopath}:%{gopath} +%else +export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} +%endif + +%if ! 0%{?gotest:1} +%global gotest go test +%endif + +%gotest %{import_path}/pkg/ip +#%%gotest %%{import_path}/remote +%gotest %{import_path}/subnet %endif %post @@ -201,8 +253,12 @@ go test %{import_path}/subnet %postun %systemd_postun_with_restart flanneld.service +#define license tag if not already defined +%{!?_licensedir:%global license %doc} + %files -%doc CONTRIBUTING.md LICENSE MAINTAINERS README.md DCO NOTICE +%license LICENSE +%doc CONTRIBUTING.md MAINTAINERS README.md DCO NOTICE %{_bindir}/flanneld %{_unitdir}/flanneld.service %{_unitdir}/docker.service.d/flannel.conf @@ -212,14 +268,23 @@ go test %{import_path}/subnet %{_tmpfilesdir}/%{name}.conf %if 0%{?with_devel} -%files devel -%doc CONTRIBUTING.md LICENSE MAINTAINERS README.md DCO NOTICE +%files devel -f devel.file-list +%license LICENSE +%doc CONTRIBUTING.md MAINTAINERS README.md DCO NOTICE %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%dir %{gopath}/src/%{import_path}/ -%{gopath}/src/%{import_path}/ +%endif + +%if 0%{?with_unit_test} && 0%{?with_devel} +%files unit-test-devel -f unit-test-devel.file-list +%license LICENSE +%doc README.md %endif %changelog +* Tue Oct 20 2015 jchaloup - 0.5.4-1 +- Update to v0.5.4 + resolves: #1273211 + * Thu Oct 08 2015 jchaloup - 0.5.3-6 - Make flannel start after the network is ready diff --git a/sources b/sources index 91ea5e9..e1fa8db 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -29fa1ee94e1533ddf0517274f643c6c7 flannel-29ffccc.tar.gz +08f15b4fb4f154175ccbdafc1d57c88e flannel-84dd9b0.tar.gz