From 504b40a163ae15a2cb8d1e3328adeab1e271e033 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 02 2017 18:55:43 +0000 Subject: import flannel-0.7.0-1.el7 --- diff --git a/.flannel.metadata b/.flannel.metadata index a5a9957..94e7594 100644 --- a/.flannel.metadata +++ b/.flannel.metadata @@ -1 +1 @@ -e8414f009ef28eea7c7a0f17235167186caaaa58 SOURCES/flannel-cb8284f.tar.gz +11788a86d489c281cf53690c66cef9c7bd02c591 SOURCES/flannel-d9560b0.tar.gz diff --git a/.gitignore b/.gitignore index faa820a..9ff375e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/flannel-cb8284f.tar.gz +SOURCES/flannel-d9560b0.tar.gz diff --git a/SOURCES/change-4001-to-2379-in-help-and-README.patch b/SOURCES/change-4001-to-2379-in-help-and-README.patch index 4716763..0a5847a 100644 --- a/SOURCES/change-4001-to-2379-in-help-and-README.patch +++ b/SOURCES/change-4001-to-2379-in-help-and-README.patch @@ -1,6 +1,6 @@ -From 3bc5bbbee3fdedcd26047c5aaaa8c6b3d68503b9 Mon Sep 17 00:00:00 2001 +From ddafb2f121148b778081c5c934032870e755c59f Mon Sep 17 00:00:00 2001 From: Jan Chaloupka -Date: Thu, 10 Sep 2015 16:38:02 +0200 +Date: Fri, 16 Dec 2016 17:01:13 +0100 Subject: [PATCH] change 4001 to 2379 in help and README --- @@ -9,10 +9,10 @@ Subject: [PATCH] change 4001 to 2379 in help and README 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md -index 65b0c1f..d27d954 100644 +index dffd3ad..6e691c6 100644 --- a/README.md +++ b/README.md -@@ -178,7 +178,7 @@ $ flanneld --remote=10.0.0.3:8888 --networks=blue,green +@@ -182,7 +182,7 @@ $ flanneld --remote=10.0.0.3:8888 --networks=blue,green ``` --public-ip="": IP accessible by other nodes for inter-host communication. Defaults to the IP of the interface being used for communication. @@ -22,18 +22,18 @@ index 65b0c1f..d27d954 100644 --etcd-keyfile="": SSL key file used to secure etcd communication. --etcd-certfile="": SSL certification file used to secure etcd communication. diff --git a/main.go b/main.go -index 9e10455..88298bc 100644 +index d6dc894..b6493e0 100644 --- a/main.go +++ b/main.go -@@ -62,7 +62,7 @@ var opts CmdLineOpts +@@ -61,7 +61,7 @@ type CmdLineOpts struct { + var opts CmdLineOpts func init() { - flag.StringVar(&opts.publicIP, "public-ip", "", "IP accessible by other nodes for inter-host communication") - flag.StringVar(&opts.etcdEndpoints, "etcd-endpoints", "http://127.0.0.1:4001,http://127.0.0.1:2379", "a comma-delimited list of etcd endpoints") + flag.StringVar(&opts.etcdEndpoints, "etcd-endpoints", "http://127.0.0.1:2379", "a comma-delimited list of etcd endpoints") flag.StringVar(&opts.etcdPrefix, "etcd-prefix", "/coreos.com/network", "etcd prefix") flag.StringVar(&opts.etcdKeyfile, "etcd-keyfile", "", "SSL key file used to secure etcd communication") flag.StringVar(&opts.etcdCertfile, "etcd-certfile", "", "SSL certification file used to secure etcd communication") -- -1.9.3 +2.7.4 diff --git a/SOURCES/change-coreos.com-network-to-atomic.io-network-in-he.patch b/SOURCES/change-coreos.com-network-to-atomic.io-network-in-he.patch index f3022fa..99cfafc 100644 --- a/SOURCES/change-coreos.com-network-to-atomic.io-network-in-he.patch +++ b/SOURCES/change-coreos.com-network-to-atomic.io-network-in-he.patch @@ -1,6 +1,6 @@ -From 0c636fe977a4503dd2ff6ec6d1316606f9d7ff44 Mon Sep 17 00:00:00 2001 +From a9ca02c0e9ec58f86171a1bf9d122bd1d1656d01 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka -Date: Thu, 17 Sep 2015 14:44:33 +0200 +Date: Fri, 16 Dec 2016 17:07:05 +0100 Subject: [PATCH] change coreos.com/network to atomic.io/network in help and docs @@ -9,13 +9,16 @@ Subject: [PATCH] change coreos.com/network to atomic.io/network in help and Documentation/gce-backend.md | 2 +- README.md | 10 +++++----- main.go | 2 +- - 4 files changed, 8 insertions(+), 8 deletions(-) + subnet/mock_etcd_test.go | 34 +++++++++++++++++----------------- + subnet/registry.go | 2 +- + subnet/registry_test.go | 8 ++++---- + 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Documentation/aws-vpc-backend.md b/Documentation/aws-vpc-backend.md -index abd6218..bf045bb 100644 +index 357c9e9..68217d4 100644 --- a/Documentation/aws-vpc-backend.md +++ b/Documentation/aws-vpc-backend.md -@@ -114,7 +114,7 @@ $ etcd2 -advertise-client-urls http://$INTERNAL_IP:2379 -listen-client-urls http +@@ -116,7 +116,7 @@ $ etcd2 -advertise-client-urls http://$INTERNAL_IP:2379 -listen-client-urls http - Publish configuration in etcd (ensure that the network range does not overlap with the one configured for the VPC) ``` @@ -25,7 +28,7 @@ index abd6218..bf045bb 100644 - Fetch the latest release using wget from [here](https://github.com/coreos/flannel/releases/download/v0.5.0/flannel-0.5.0-linux-amd64.tar.gz) - Run flannel daemon: diff --git a/Documentation/gce-backend.md b/Documentation/gce-backend.md -index 50245b4..595839b 100644 +index 35ed8b4..675c4b0 100644 --- a/Documentation/gce-backend.md +++ b/Documentation/gce-backend.md @@ -44,7 +44,7 @@ $ etcd2 -advertise-client-urls http://$INTERNAL_IP:2379 -listen-client-urls http @@ -38,10 +41,10 @@ index 50245b4..595839b 100644 - Fetch the 0.5 release using wget from [here](https://github.com/coreos/flannel/releases/download/v0.5.0/flannel-0.5.0-linux-amd64.tar.gz) diff --git a/README.md b/README.md -index d27d954..f31552b 100644 +index 6e691c6..7b05d41 100644 --- a/README.md +++ b/README.md -@@ -41,7 +41,7 @@ docker run -v $SRC:/opt/flannel -i -t google/golang /bin/bash -c "cd /opt/flanne +@@ -43,7 +43,7 @@ docker run -v $SRC:/opt/flannel -i -t google/golang /bin/bash -c "cd /opt/flanne ## Configuration flannel reads its configuration from etcd. @@ -50,7 +53,7 @@ index d27d954..f31552b 100644 You can use `etcdctl` utility to set values in etcd. The value of the config is a JSON dictionary with the following keys: -@@ -143,9 +143,9 @@ Multi-network mode allows a single flannel daemon to join multiple networks. +@@ -147,9 +147,9 @@ Multi-network mode allows a single flannel daemon to join multiple networks. Each network is independent from each other and has its own configuration, IP space, interfaces. To configure three networks -- in this example named `blue`, `green`, and `red` -- start by publishing their configurations to etcd in different locations: ``` @@ -63,7 +66,7 @@ index d27d954..f31552b 100644 ``` Next, start the flannel daemon, specifying the networks to join: -@@ -179,7 +179,7 @@ $ flanneld --remote=10.0.0.3:8888 --networks=blue,green +@@ -183,7 +183,7 @@ $ flanneld --remote=10.0.0.3:8888 --networks=blue,green ``` --public-ip="": IP accessible by other nodes for inter-host communication. Defaults to the IP of the interface being used for communication. --etcd-endpoints=http://127.0.0.1:2379: a comma-delimited list of etcd endpoints. @@ -73,18 +76,168 @@ index d27d954..f31552b 100644 --etcd-certfile="": SSL certification file used to secure etcd communication. --etcd-cafile="": SSL Certificate Authority file used to secure etcd communication. diff --git a/main.go b/main.go -index 88298bc..e0ccd22 100644 +index b6493e0..5adfb55 100644 --- a/main.go +++ b/main.go -@@ -63,7 +63,7 @@ var opts CmdLineOpts +@@ -62,7 +62,7 @@ var opts CmdLineOpts + func init() { - flag.StringVar(&opts.publicIP, "public-ip", "", "IP accessible by other nodes for inter-host communication") flag.StringVar(&opts.etcdEndpoints, "etcd-endpoints", "http://127.0.0.1:2379", "a comma-delimited list of etcd endpoints") - flag.StringVar(&opts.etcdPrefix, "etcd-prefix", "/coreos.com/network", "etcd prefix") + flag.StringVar(&opts.etcdPrefix, "etcd-prefix", "/atomic.io/network", "etcd prefix") flag.StringVar(&opts.etcdKeyfile, "etcd-keyfile", "", "SSL key file used to secure etcd communication") flag.StringVar(&opts.etcdCertfile, "etcd-certfile", "", "SSL certification file used to secure etcd communication") flag.StringVar(&opts.etcdCAFile, "etcd-cafile", "", "SSL Certificate Authority file used to secure etcd communication") +diff --git a/subnet/mock_etcd_test.go b/subnet/mock_etcd_test.go +index 8927cd2..e838282 100644 +--- a/subnet/mock_etcd_test.go ++++ b/subnet/mock_etcd_test.go +@@ -70,17 +70,17 @@ func watchMockEtcd(ctx context.Context, watcher etcd.Watcher, result chan error) + } + + expected := []evt{ +- {"/coreos.com/network/foobar/config", "create", false}, +- {"/coreos.com/network/blah/config", "create", false}, +- {"/coreos.com/network/blah/config", "update", false}, +- {"/coreos.com/network/foobar/config", "delete", false}, +- {"/coreos.com/network/foobar", "delete", false}, ++ {"/atomic.io/network/foobar/config", "create", false}, ++ {"/atomic.io/network/blah/config", "create", false}, ++ {"/atomic.io/network/blah/config", "update", false}, ++ {"/atomic.io/network/foobar/config", "delete", false}, ++ {"/atomic.io/network/foobar", "delete", false}, + } + +- // Wait for delete events on /coreos.com/network/foobar and its ++ // Wait for delete events on /atomic.io/network/foobar and its + // 'config' child, and for the update event on +- // /coreos.com/network/foobar (for 'config' delete) and on +- // /coreos.com/network (for 'foobar' delete) ++ // /atomic.io/network/foobar (for 'config' delete) and on ++ // /atomic.io/network (for 'foobar' delete) + numEvents := 0 + for { + resp, err := watcher.Next(ctx) +@@ -134,24 +134,24 @@ func TestMockEtcd(t *testing.T) { + + // Create base test keys + sopts := &etcd.SetOptions{Dir: true} +- r, err = m.Set(ctx, "/coreos.com/network", "", sopts) ++ r, err = m.Set(ctx, "/atomic.io/network", "", sopts) + e = &etcd.Response{Action: "create", Index: 1002} + expectSuccess(t, r, err, e, "") + + wopts := &etcd.WatcherOptions{AfterIndex: m.index, Recursive: true} +- watcher := m.Watcher("/coreos.com/network", wopts) ++ watcher := m.Watcher("/atomic.io/network", wopts) + + result := make(chan error, 1) + go watchMockEtcd(ctx, watcher, result) + + // Populate etcd with some keys +- netKey1 := "/coreos.com/network/foobar/config" ++ netKey1 := "/atomic.io/network/foobar/config" + netValue := "{ \"Network\": \"10.1.0.0/16\", \"Backend\": { \"Type\": \"host-gw\" } }" + r, err = m.Create(ctx, netKey1, netValue) + e = &etcd.Response{Action: "create", Index: 1004} + expectSuccess(t, r, err, e, netValue) + +- netKey2 := "/coreos.com/network/blah/config" ++ netKey2 := "/atomic.io/network/blah/config" + netValue = "{ \"Network\": \"10.1.1.0/16\", \"Backend\": { \"Type\": \"host-gw\" } }" + r, err = m.Create(ctx, netKey2, netValue) + e = &etcd.Response{Action: "create", Index: 1006} +@@ -178,7 +178,7 @@ func TestMockEtcd(t *testing.T) { + + // test directory listing + opts = &etcd.GetOptions{Recursive: true, Quorum: true} +- r, err = m.Get(ctx, "/coreos.com/network/", opts) ++ r, err = m.Get(ctx, "/atomic.io/network/", opts) + e = &etcd.Response{Action: "get", Index: 1007} + expectSuccess(t, r, err, e, "") + +@@ -191,9 +191,9 @@ func TestMockEtcd(t *testing.T) { + if child.Dir != true { + t.Fatalf("Unexpected non-directory child %s", child.Key) + } +- if child.Key == "/coreos.com/network/foobar" { ++ if child.Key == "/atomic.io/network/foobar" { + node1Found = true +- } else if child.Key == "/coreos.com/network/blah" { ++ } else if child.Key == "/atomic.io/network/blah" { + node2Found = true + } else { + t.Fatalf("Unexpected child %s found", child.Key) +@@ -208,14 +208,14 @@ func TestMockEtcd(t *testing.T) { + + // Delete a key + dopts := &etcd.DeleteOptions{Recursive: true, Dir: false} +- r, err = m.Delete(ctx, "/coreos.com/network/foobar", dopts) ++ r, err = m.Delete(ctx, "/atomic.io/network/foobar", dopts) + if err == nil { + t.Fatalf("Unexpected success deleting a directory") + } + + // Delete a key + dopts = &etcd.DeleteOptions{Recursive: true, Dir: true} +- r, err = m.Delete(ctx, "/coreos.com/network/foobar", dopts) ++ r, err = m.Delete(ctx, "/atomic.io/network/foobar", dopts) + e = &etcd.Response{Action: "delete", Index: 1010} + expectSuccess(t, r, err, e, "") + +diff --git a/subnet/registry.go b/subnet/registry.go +index dd8083b..42cbfb0 100644 +--- a/subnet/registry.go ++++ b/subnet/registry.go +@@ -384,7 +384,7 @@ func (esr *etcdSubnetRegistry) parseNetworkWatchResponse(resp *etcd.Response) (E + return evt, index, nil + } + +-// Returns network name from config key (eg, /coreos.com/network/foobar/config), ++// Returns network name from config key (eg, /atomic.io/network/foobar/config), + // if the 'config' key isn't present we don't consider the network valid + func (esr *etcdSubnetRegistry) parseNetworkKey(s string) (string, bool) { + if parts := esr.networkRegex.FindStringSubmatch(s); len(parts) == 3 { +diff --git a/subnet/registry_test.go b/subnet/registry_test.go +index 8d7524f..4c64423 100644 +--- a/subnet/registry_test.go ++++ b/subnet/registry_test.go +@@ -29,7 +29,7 @@ import ( + func newTestEtcdRegistry(t *testing.T) (Registry, *mockEtcd) { + cfg := &EtcdConfig{ + Endpoints: []string{"http://127.0.0.1:4001", "http://127.0.0.1:2379"}, +- Prefix: "/coreos.com/network", ++ Prefix: "/atomic.io/network", + } + + r, err := newEtcdSubnetRegistry(cfg, func(c *EtcdConfig) (etcd.KeysAPI, error) { +@@ -105,7 +105,7 @@ func TestEtcdRegistry(t *testing.T) { + } + + // Populate etcd with a network +- netKey := "/coreos.com/network/foobar/config" ++ netKey := "/atomic.io/network/foobar/config" + netValue := "{ \"Network\": \"10.1.0.0/16\", \"Backend\": { \"Type\": \"host-gw\" } }" + m.Create(ctx, netKey, netValue) + +@@ -155,7 +155,7 @@ func TestEtcdRegistry(t *testing.T) { + } + + // Make sure the lease got created +- resp, err := m.Get(ctx, "/coreos.com/network/foobar/subnets/10.1.5.0-24", nil) ++ resp, err := m.Get(ctx, "/atomic.io/network/foobar/subnets/10.1.5.0-24", nil) + if err != nil { + t.Fatal("Failed to verify subnet lease directly in etcd: %v", err) + } +@@ -185,7 +185,7 @@ func TestEtcdRegistry(t *testing.T) { + } + + // Make sure the lease got deleted +- resp, err = m.Get(ctx, "/coreos.com/network/foobar/subnets/10.1.5.0-24", nil) ++ resp, err = m.Get(ctx, "/atomic.io/network/foobar/subnets/10.1.5.0-24", nil) + if err == nil { + t.Fatal("Unexpected success getting deleted subnet") + } -- -1.9.3 +2.7.4 diff --git a/SOURCES/internal-to-inteernal.patch b/SOURCES/internal-to-inteernal.patch deleted file mode 100644 index 0932016..0000000 --- a/SOURCES/internal-to-inteernal.patch +++ /dev/null @@ -1,853 +0,0 @@ -From 57e0d7d32a08e28ffb8e42704bbf2d6e7906e0b1 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Thu, 14 Jan 2016 21:14:10 +0100 -Subject: [PATCH] internal->inteernal - ---- - .../p/google-api-go-client/googleapi/googleapi.go | 2 +- - .../googleapi/inteernal/uritemplates/LICENSE | 18 ++ - .../inteernal/uritemplates/uritemplates.go | 359 +++++++++++++++++++++ - .../googleapi/inteernal/uritemplates/utils.go | 13 + - .../googleapi/internal/uritemplates/LICENSE | 18 -- - .../internal/uritemplates/uritemplates.go | 359 --------------------- - .../googleapi/internal/uritemplates/utils.go | 13 - - 7 files changed, 391 insertions(+), 391 deletions(-) - create mode 100644 Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/LICENSE - create mode 100644 Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/uritemplates.go - create mode 100644 Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/utils.go - delete mode 100644 Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/LICENSE - delete mode 100644 Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/uritemplates.go - delete mode 100644 Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/utils.go - -diff --git a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/googleapi.go b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/googleapi.go -index 7a0df3d..6922de4 100644 ---- a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/googleapi.go -+++ b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/googleapi.go -@@ -19,7 +19,7 @@ import ( - "os" - "strings" - -- "github.com/coreos/flannel/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates" -+ "github.com/coreos/flannel/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates" - ) - - // ContentTyper is an interface for Readers which know (or would like -diff --git a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/LICENSE b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/LICENSE -new file mode 100644 -index 0000000..de9c88c ---- /dev/null -+++ b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/LICENSE -@@ -0,0 +1,18 @@ -+Copyright (c) 2013 Joshua Tacoma -+ -+Permission is hereby granted, free of charge, to any person obtaining a copy of -+this software and associated documentation files (the "Software"), to deal in -+the Software without restriction, including without limitation the rights to -+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -+the Software, and to permit persons to whom the Software is furnished to do so, -+subject to the following conditions: -+ -+The above copyright notice and this permission notice shall be included in all -+copies or substantial portions of the Software. -+ -+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -diff --git a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/uritemplates.go b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/uritemplates.go -new file mode 100644 -index 0000000..8a84813 ---- /dev/null -+++ b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/uritemplates.go -@@ -0,0 +1,359 @@ -+// Copyright 2013 Joshua Tacoma. All rights reserved. -+// Use of this source code is governed by a BSD-style -+// license that can be found in the LICENSE file. -+ -+// Package uritemplates is a level 4 implementation of RFC 6570 (URI -+// Template, http://tools.ietf.org/html/rfc6570). -+// -+// To use uritemplates, parse a template string and expand it with a value -+// map: -+// -+// template, _ := uritemplates.Parse("https://api.github.com/repos{/user,repo}") -+// values := make(map[string]interface{}) -+// values["user"] = "jtacoma" -+// values["repo"] = "uritemplates" -+// expanded, _ := template.ExpandString(values) -+// fmt.Printf(expanded) -+// -+package uritemplates -+ -+import ( -+ "bytes" -+ "errors" -+ "fmt" -+ "reflect" -+ "regexp" -+ "strconv" -+ "strings" -+) -+ -+var ( -+ unreserved = regexp.MustCompile("[^A-Za-z0-9\\-._~]") -+ reserved = regexp.MustCompile("[^A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=]") -+ validname = regexp.MustCompile("^([A-Za-z0-9_\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$") -+ hex = []byte("0123456789ABCDEF") -+) -+ -+func pctEncode(src []byte) []byte { -+ dst := make([]byte, len(src)*3) -+ for i, b := range src { -+ buf := dst[i*3 : i*3+3] -+ buf[0] = 0x25 -+ buf[1] = hex[b/16] -+ buf[2] = hex[b%16] -+ } -+ return dst -+} -+ -+func escape(s string, allowReserved bool) (escaped string) { -+ if allowReserved { -+ escaped = string(reserved.ReplaceAllFunc([]byte(s), pctEncode)) -+ } else { -+ escaped = string(unreserved.ReplaceAllFunc([]byte(s), pctEncode)) -+ } -+ return escaped -+} -+ -+// A UriTemplate is a parsed representation of a URI template. -+type UriTemplate struct { -+ raw string -+ parts []templatePart -+} -+ -+// Parse parses a URI template string into a UriTemplate object. -+func Parse(rawtemplate string) (template *UriTemplate, err error) { -+ template = new(UriTemplate) -+ template.raw = rawtemplate -+ split := strings.Split(rawtemplate, "{") -+ template.parts = make([]templatePart, len(split)*2-1) -+ for i, s := range split { -+ if i == 0 { -+ if strings.Contains(s, "}") { -+ err = errors.New("unexpected }") -+ break -+ } -+ template.parts[i].raw = s -+ } else { -+ subsplit := strings.Split(s, "}") -+ if len(subsplit) != 2 { -+ err = errors.New("malformed template") -+ break -+ } -+ expression := subsplit[0] -+ template.parts[i*2-1], err = parseExpression(expression) -+ if err != nil { -+ break -+ } -+ template.parts[i*2].raw = subsplit[1] -+ } -+ } -+ if err != nil { -+ template = nil -+ } -+ return template, err -+} -+ -+type templatePart struct { -+ raw string -+ terms []templateTerm -+ first string -+ sep string -+ named bool -+ ifemp string -+ allowReserved bool -+} -+ -+type templateTerm struct { -+ name string -+ explode bool -+ truncate int -+} -+ -+func parseExpression(expression string) (result templatePart, err error) { -+ switch expression[0] { -+ case '+': -+ result.sep = "," -+ result.allowReserved = true -+ expression = expression[1:] -+ case '.': -+ result.first = "." -+ result.sep = "." -+ expression = expression[1:] -+ case '/': -+ result.first = "/" -+ result.sep = "/" -+ expression = expression[1:] -+ case ';': -+ result.first = ";" -+ result.sep = ";" -+ result.named = true -+ expression = expression[1:] -+ case '?': -+ result.first = "?" -+ result.sep = "&" -+ result.named = true -+ result.ifemp = "=" -+ expression = expression[1:] -+ case '&': -+ result.first = "&" -+ result.sep = "&" -+ result.named = true -+ result.ifemp = "=" -+ expression = expression[1:] -+ case '#': -+ result.first = "#" -+ result.sep = "," -+ result.allowReserved = true -+ expression = expression[1:] -+ default: -+ result.sep = "," -+ } -+ rawterms := strings.Split(expression, ",") -+ result.terms = make([]templateTerm, len(rawterms)) -+ for i, raw := range rawterms { -+ result.terms[i], err = parseTerm(raw) -+ if err != nil { -+ break -+ } -+ } -+ return result, err -+} -+ -+func parseTerm(term string) (result templateTerm, err error) { -+ if strings.HasSuffix(term, "*") { -+ result.explode = true -+ term = term[:len(term)-1] -+ } -+ split := strings.Split(term, ":") -+ if len(split) == 1 { -+ result.name = term -+ } else if len(split) == 2 { -+ result.name = split[0] -+ var parsed int64 -+ parsed, err = strconv.ParseInt(split[1], 10, 0) -+ result.truncate = int(parsed) -+ } else { -+ err = errors.New("multiple colons in same term") -+ } -+ if !validname.MatchString(result.name) { -+ err = errors.New("not a valid name: " + result.name) -+ } -+ if result.explode && result.truncate > 0 { -+ err = errors.New("both explode and prefix modifers on same term") -+ } -+ return result, err -+} -+ -+// Expand expands a URI template with a set of values to produce a string. -+func (self *UriTemplate) Expand(value interface{}) (string, error) { -+ values, ismap := value.(map[string]interface{}) -+ if !ismap { -+ if m, ismap := struct2map(value); !ismap { -+ return "", errors.New("expected map[string]interface{}, struct, or pointer to struct.") -+ } else { -+ return self.Expand(m) -+ } -+ } -+ var buf bytes.Buffer -+ for _, p := range self.parts { -+ err := p.expand(&buf, values) -+ if err != nil { -+ return "", err -+ } -+ } -+ return buf.String(), nil -+} -+ -+func (self *templatePart) expand(buf *bytes.Buffer, values map[string]interface{}) error { -+ if len(self.raw) > 0 { -+ buf.WriteString(self.raw) -+ return nil -+ } -+ var zeroLen = buf.Len() -+ buf.WriteString(self.first) -+ var firstLen = buf.Len() -+ for _, term := range self.terms { -+ value, exists := values[term.name] -+ if !exists { -+ continue -+ } -+ if buf.Len() != firstLen { -+ buf.WriteString(self.sep) -+ } -+ switch v := value.(type) { -+ case string: -+ self.expandString(buf, term, v) -+ case []interface{}: -+ self.expandArray(buf, term, v) -+ case map[string]interface{}: -+ if term.truncate > 0 { -+ return errors.New("cannot truncate a map expansion") -+ } -+ self.expandMap(buf, term, v) -+ default: -+ if m, ismap := struct2map(value); ismap { -+ if term.truncate > 0 { -+ return errors.New("cannot truncate a map expansion") -+ } -+ self.expandMap(buf, term, m) -+ } else { -+ str := fmt.Sprintf("%v", value) -+ self.expandString(buf, term, str) -+ } -+ } -+ } -+ if buf.Len() == firstLen { -+ original := buf.Bytes()[:zeroLen] -+ buf.Reset() -+ buf.Write(original) -+ } -+ return nil -+} -+ -+func (self *templatePart) expandName(buf *bytes.Buffer, name string, empty bool) { -+ if self.named { -+ buf.WriteString(name) -+ if empty { -+ buf.WriteString(self.ifemp) -+ } else { -+ buf.WriteString("=") -+ } -+ } -+} -+ -+func (self *templatePart) expandString(buf *bytes.Buffer, t templateTerm, s string) { -+ if len(s) > t.truncate && t.truncate > 0 { -+ s = s[:t.truncate] -+ } -+ self.expandName(buf, t.name, len(s) == 0) -+ buf.WriteString(escape(s, self.allowReserved)) -+} -+ -+func (self *templatePart) expandArray(buf *bytes.Buffer, t templateTerm, a []interface{}) { -+ if len(a) == 0 { -+ return -+ } else if !t.explode { -+ self.expandName(buf, t.name, false) -+ } -+ for i, value := range a { -+ if t.explode && i > 0 { -+ buf.WriteString(self.sep) -+ } else if i > 0 { -+ buf.WriteString(",") -+ } -+ var s string -+ switch v := value.(type) { -+ case string: -+ s = v -+ default: -+ s = fmt.Sprintf("%v", v) -+ } -+ if len(s) > t.truncate && t.truncate > 0 { -+ s = s[:t.truncate] -+ } -+ if self.named && t.explode { -+ self.expandName(buf, t.name, len(s) == 0) -+ } -+ buf.WriteString(escape(s, self.allowReserved)) -+ } -+} -+ -+func (self *templatePart) expandMap(buf *bytes.Buffer, t templateTerm, m map[string]interface{}) { -+ if len(m) == 0 { -+ return -+ } -+ if !t.explode { -+ self.expandName(buf, t.name, len(m) == 0) -+ } -+ var firstLen = buf.Len() -+ for k, value := range m { -+ if firstLen != buf.Len() { -+ if t.explode { -+ buf.WriteString(self.sep) -+ } else { -+ buf.WriteString(",") -+ } -+ } -+ var s string -+ switch v := value.(type) { -+ case string: -+ s = v -+ default: -+ s = fmt.Sprintf("%v", v) -+ } -+ if t.explode { -+ buf.WriteString(escape(k, self.allowReserved)) -+ buf.WriteRune('=') -+ buf.WriteString(escape(s, self.allowReserved)) -+ } else { -+ buf.WriteString(escape(k, self.allowReserved)) -+ buf.WriteRune(',') -+ buf.WriteString(escape(s, self.allowReserved)) -+ } -+ } -+} -+ -+func struct2map(v interface{}) (map[string]interface{}, bool) { -+ value := reflect.ValueOf(v) -+ switch value.Type().Kind() { -+ case reflect.Ptr: -+ return struct2map(value.Elem().Interface()) -+ case reflect.Struct: -+ m := make(map[string]interface{}) -+ for i := 0; i < value.NumField(); i++ { -+ tag := value.Type().Field(i).Tag -+ var name string -+ if strings.Contains(string(tag), ":") { -+ name = tag.Get("uri") -+ } else { -+ name = strings.TrimSpace(string(tag)) -+ } -+ if len(name) == 0 { -+ name = value.Type().Field(i).Name -+ } -+ m[name] = value.Field(i).Interface() -+ } -+ return m, true -+ } -+ return nil, false -+} -diff --git a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/utils.go b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/utils.go -new file mode 100644 -index 0000000..399ef46 ---- /dev/null -+++ b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/inteernal/uritemplates/utils.go -@@ -0,0 +1,13 @@ -+package uritemplates -+ -+func Expand(path string, expansions map[string]string) (string, error) { -+ template, err := Parse(path) -+ if err != nil { -+ return "", err -+ } -+ values := make(map[string]interface{}) -+ for k, v := range expansions { -+ values[k] = v -+ } -+ return template.Expand(values) -+} -diff --git a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/LICENSE b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/LICENSE -deleted file mode 100644 -index de9c88c..0000000 ---- a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/LICENSE -+++ /dev/null -@@ -1,18 +0,0 @@ --Copyright (c) 2013 Joshua Tacoma -- --Permission is hereby granted, free of charge, to any person obtaining a copy of --this software and associated documentation files (the "Software"), to deal in --the Software without restriction, including without limitation the rights to --use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of --the Software, and to permit persons to whom the Software is furnished to do so, --subject to the following conditions: -- --The above copyright notice and this permission notice shall be included in all --copies or substantial portions of the Software. -- --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS --FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR --COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER --IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN --CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -diff --git a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/uritemplates.go b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/uritemplates.go -deleted file mode 100644 -index 8a84813..0000000 ---- a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/uritemplates.go -+++ /dev/null -@@ -1,359 +0,0 @@ --// Copyright 2013 Joshua Tacoma. All rights reserved. --// Use of this source code is governed by a BSD-style --// license that can be found in the LICENSE file. -- --// Package uritemplates is a level 4 implementation of RFC 6570 (URI --// Template, http://tools.ietf.org/html/rfc6570). --// --// To use uritemplates, parse a template string and expand it with a value --// map: --// --// template, _ := uritemplates.Parse("https://api.github.com/repos{/user,repo}") --// values := make(map[string]interface{}) --// values["user"] = "jtacoma" --// values["repo"] = "uritemplates" --// expanded, _ := template.ExpandString(values) --// fmt.Printf(expanded) --// --package uritemplates -- --import ( -- "bytes" -- "errors" -- "fmt" -- "reflect" -- "regexp" -- "strconv" -- "strings" --) -- --var ( -- unreserved = regexp.MustCompile("[^A-Za-z0-9\\-._~]") -- reserved = regexp.MustCompile("[^A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=]") -- validname = regexp.MustCompile("^([A-Za-z0-9_\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$") -- hex = []byte("0123456789ABCDEF") --) -- --func pctEncode(src []byte) []byte { -- dst := make([]byte, len(src)*3) -- for i, b := range src { -- buf := dst[i*3 : i*3+3] -- buf[0] = 0x25 -- buf[1] = hex[b/16] -- buf[2] = hex[b%16] -- } -- return dst --} -- --func escape(s string, allowReserved bool) (escaped string) { -- if allowReserved { -- escaped = string(reserved.ReplaceAllFunc([]byte(s), pctEncode)) -- } else { -- escaped = string(unreserved.ReplaceAllFunc([]byte(s), pctEncode)) -- } -- return escaped --} -- --// A UriTemplate is a parsed representation of a URI template. --type UriTemplate struct { -- raw string -- parts []templatePart --} -- --// Parse parses a URI template string into a UriTemplate object. --func Parse(rawtemplate string) (template *UriTemplate, err error) { -- template = new(UriTemplate) -- template.raw = rawtemplate -- split := strings.Split(rawtemplate, "{") -- template.parts = make([]templatePart, len(split)*2-1) -- for i, s := range split { -- if i == 0 { -- if strings.Contains(s, "}") { -- err = errors.New("unexpected }") -- break -- } -- template.parts[i].raw = s -- } else { -- subsplit := strings.Split(s, "}") -- if len(subsplit) != 2 { -- err = errors.New("malformed template") -- break -- } -- expression := subsplit[0] -- template.parts[i*2-1], err = parseExpression(expression) -- if err != nil { -- break -- } -- template.parts[i*2].raw = subsplit[1] -- } -- } -- if err != nil { -- template = nil -- } -- return template, err --} -- --type templatePart struct { -- raw string -- terms []templateTerm -- first string -- sep string -- named bool -- ifemp string -- allowReserved bool --} -- --type templateTerm struct { -- name string -- explode bool -- truncate int --} -- --func parseExpression(expression string) (result templatePart, err error) { -- switch expression[0] { -- case '+': -- result.sep = "," -- result.allowReserved = true -- expression = expression[1:] -- case '.': -- result.first = "." -- result.sep = "." -- expression = expression[1:] -- case '/': -- result.first = "/" -- result.sep = "/" -- expression = expression[1:] -- case ';': -- result.first = ";" -- result.sep = ";" -- result.named = true -- expression = expression[1:] -- case '?': -- result.first = "?" -- result.sep = "&" -- result.named = true -- result.ifemp = "=" -- expression = expression[1:] -- case '&': -- result.first = "&" -- result.sep = "&" -- result.named = true -- result.ifemp = "=" -- expression = expression[1:] -- case '#': -- result.first = "#" -- result.sep = "," -- result.allowReserved = true -- expression = expression[1:] -- default: -- result.sep = "," -- } -- rawterms := strings.Split(expression, ",") -- result.terms = make([]templateTerm, len(rawterms)) -- for i, raw := range rawterms { -- result.terms[i], err = parseTerm(raw) -- if err != nil { -- break -- } -- } -- return result, err --} -- --func parseTerm(term string) (result templateTerm, err error) { -- if strings.HasSuffix(term, "*") { -- result.explode = true -- term = term[:len(term)-1] -- } -- split := strings.Split(term, ":") -- if len(split) == 1 { -- result.name = term -- } else if len(split) == 2 { -- result.name = split[0] -- var parsed int64 -- parsed, err = strconv.ParseInt(split[1], 10, 0) -- result.truncate = int(parsed) -- } else { -- err = errors.New("multiple colons in same term") -- } -- if !validname.MatchString(result.name) { -- err = errors.New("not a valid name: " + result.name) -- } -- if result.explode && result.truncate > 0 { -- err = errors.New("both explode and prefix modifers on same term") -- } -- return result, err --} -- --// Expand expands a URI template with a set of values to produce a string. --func (self *UriTemplate) Expand(value interface{}) (string, error) { -- values, ismap := value.(map[string]interface{}) -- if !ismap { -- if m, ismap := struct2map(value); !ismap { -- return "", errors.New("expected map[string]interface{}, struct, or pointer to struct.") -- } else { -- return self.Expand(m) -- } -- } -- var buf bytes.Buffer -- for _, p := range self.parts { -- err := p.expand(&buf, values) -- if err != nil { -- return "", err -- } -- } -- return buf.String(), nil --} -- --func (self *templatePart) expand(buf *bytes.Buffer, values map[string]interface{}) error { -- if len(self.raw) > 0 { -- buf.WriteString(self.raw) -- return nil -- } -- var zeroLen = buf.Len() -- buf.WriteString(self.first) -- var firstLen = buf.Len() -- for _, term := range self.terms { -- value, exists := values[term.name] -- if !exists { -- continue -- } -- if buf.Len() != firstLen { -- buf.WriteString(self.sep) -- } -- switch v := value.(type) { -- case string: -- self.expandString(buf, term, v) -- case []interface{}: -- self.expandArray(buf, term, v) -- case map[string]interface{}: -- if term.truncate > 0 { -- return errors.New("cannot truncate a map expansion") -- } -- self.expandMap(buf, term, v) -- default: -- if m, ismap := struct2map(value); ismap { -- if term.truncate > 0 { -- return errors.New("cannot truncate a map expansion") -- } -- self.expandMap(buf, term, m) -- } else { -- str := fmt.Sprintf("%v", value) -- self.expandString(buf, term, str) -- } -- } -- } -- if buf.Len() == firstLen { -- original := buf.Bytes()[:zeroLen] -- buf.Reset() -- buf.Write(original) -- } -- return nil --} -- --func (self *templatePart) expandName(buf *bytes.Buffer, name string, empty bool) { -- if self.named { -- buf.WriteString(name) -- if empty { -- buf.WriteString(self.ifemp) -- } else { -- buf.WriteString("=") -- } -- } --} -- --func (self *templatePart) expandString(buf *bytes.Buffer, t templateTerm, s string) { -- if len(s) > t.truncate && t.truncate > 0 { -- s = s[:t.truncate] -- } -- self.expandName(buf, t.name, len(s) == 0) -- buf.WriteString(escape(s, self.allowReserved)) --} -- --func (self *templatePart) expandArray(buf *bytes.Buffer, t templateTerm, a []interface{}) { -- if len(a) == 0 { -- return -- } else if !t.explode { -- self.expandName(buf, t.name, false) -- } -- for i, value := range a { -- if t.explode && i > 0 { -- buf.WriteString(self.sep) -- } else if i > 0 { -- buf.WriteString(",") -- } -- var s string -- switch v := value.(type) { -- case string: -- s = v -- default: -- s = fmt.Sprintf("%v", v) -- } -- if len(s) > t.truncate && t.truncate > 0 { -- s = s[:t.truncate] -- } -- if self.named && t.explode { -- self.expandName(buf, t.name, len(s) == 0) -- } -- buf.WriteString(escape(s, self.allowReserved)) -- } --} -- --func (self *templatePart) expandMap(buf *bytes.Buffer, t templateTerm, m map[string]interface{}) { -- if len(m) == 0 { -- return -- } -- if !t.explode { -- self.expandName(buf, t.name, len(m) == 0) -- } -- var firstLen = buf.Len() -- for k, value := range m { -- if firstLen != buf.Len() { -- if t.explode { -- buf.WriteString(self.sep) -- } else { -- buf.WriteString(",") -- } -- } -- var s string -- switch v := value.(type) { -- case string: -- s = v -- default: -- s = fmt.Sprintf("%v", v) -- } -- if t.explode { -- buf.WriteString(escape(k, self.allowReserved)) -- buf.WriteRune('=') -- buf.WriteString(escape(s, self.allowReserved)) -- } else { -- buf.WriteString(escape(k, self.allowReserved)) -- buf.WriteRune(',') -- buf.WriteString(escape(s, self.allowReserved)) -- } -- } --} -- --func struct2map(v interface{}) (map[string]interface{}, bool) { -- value := reflect.ValueOf(v) -- switch value.Type().Kind() { -- case reflect.Ptr: -- return struct2map(value.Elem().Interface()) -- case reflect.Struct: -- m := make(map[string]interface{}) -- for i := 0; i < value.NumField(); i++ { -- tag := value.Type().Field(i).Tag -- var name string -- if strings.Contains(string(tag), ":") { -- name = tag.Get("uri") -- } else { -- name = strings.TrimSpace(string(tag)) -- } -- if len(name) == 0 { -- name = value.Type().Field(i).Name -- } -- m[name] = value.Field(i).Interface() -- } -- return m, true -- } -- return nil, false --} -diff --git a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/utils.go b/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/utils.go -deleted file mode 100644 -index 399ef46..0000000 ---- a/Godeps/_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates/utils.go -+++ /dev/null -@@ -1,13 +0,0 @@ --package uritemplates -- --func Expand(path string, expansions map[string]string) (string, error) { -- template, err := Parse(path) -- if err != nil { -- return "", err -- } -- values := make(map[string]interface{}) -- for k, v := range expansions { -- values[k] = v -- } -- return template.Expand(values) --} --- -1.9.3 - diff --git a/SPECS/flannel.spec b/SPECS/flannel.spec index 7c6e983..c468064 100644 --- a/SPECS/flannel.spec +++ b/SPECS/flannel.spec @@ -14,14 +14,14 @@ %global project coreos %global repo flannel %global import_path %{provider}.%{provider_tld}/%{project}/%{repo} -%global commit cb8284fb60737793596dd2fc98d9608d3d0d66f0 +%global commit d9560b051b0abe92048ae5c72b5fbd71ba7b8f17 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global devel_main flannel-devel Name: flannel -Version: 0.5.5 -Release: 2%{?dist} +Version: 0.7.0 +Release: 1%{?dist} Summary: Etcd address management agent for overlay networks License: ASL 2.0 URL: https://%{import_path} @@ -35,7 +35,6 @@ Source5: flanneld-start Patch0: change-4001-to-2379-in-help-and-README.patch Patch1: change-coreos.com-network-to-atomic.io-network-in-he.patch -Patch3: internal-to-inteernal.patch ExclusiveArch: %{ix86} x86_64 %{arm} @@ -129,7 +128,6 @@ building other packages which use %{project}/%{repo}. %setup -q -n %{repo}-%{commit} %patch0 -p1 %patch1 -p1 -%patch3 -p1 %if ! 0%{?with_bundled} find . -name "*.go" \ @@ -147,9 +145,13 @@ export GOPATH=$(pwd):%{gopath} export GOPATH=$(pwd):%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace %endif -function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; } +%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 + +export LDFLAGS="-X github.com/coreos/flannel/version.Version=%{version}" -gobuild -o bin/flanneld . +%gobuild -o bin/flanneld %{import_path} %install # package with binary @@ -209,6 +211,10 @@ go test %{import_path}/subnet %endif %changelog +* Mon Feb 06 2017 Jan Chaloupka - 0.7.0-1 +- Update to flannel v0.7.0 + resolves: #1419750 + * Tue Dec 13 2016 Jan Chaloupka - 0.5.5-2 - Use non-canonicalized etcd endpoints and prefix if canonicalized are not set resolves: #1341223