|
|
fce617 |
From a9ca02c0e9ec58f86171a1bf9d122bd1d1656d01 Mon Sep 17 00:00:00 2001
|
|
|
fce617 |
From: Jan Chaloupka <jchaloup@redhat.com>
|
|
|
fce617 |
Date: Fri, 16 Dec 2016 17:07:05 +0100
|
|
|
fce617 |
Subject: [PATCH] change coreos.com/network to atomic.io/network in help and
|
|
|
fce617 |
docs
|
|
|
fce617 |
|
|
|
fce617 |
---
|
|
|
fce617 |
Documentation/aws-vpc-backend.md | 2 +-
|
|
|
fce617 |
Documentation/gce-backend.md | 2 +-
|
|
|
fce617 |
README.md | 10 +++++-----
|
|
|
fce617 |
main.go | 2 +-
|
|
|
fce617 |
subnet/mock_etcd_test.go | 34 +++++++++++++++++-----------------
|
|
|
fce617 |
subnet/registry.go | 2 +-
|
|
|
fce617 |
subnet/registry_test.go | 8 ++++----
|
|
|
fce617 |
7 files changed, 30 insertions(+), 30 deletions(-)
|
|
|
fce617 |
|
|
|
fce617 |
diff --git a/Documentation/aws-vpc-backend.md b/Documentation/aws-vpc-backend.md
|
|
|
fce617 |
index 357c9e9..68217d4 100644
|
|
|
fce617 |
--- a/Documentation/aws-vpc-backend.md
|
|
|
fce617 |
+++ b/Documentation/aws-vpc-backend.md
|
|
|
fce617 |
@@ -116,7 +116,7 @@ $ etcd2 -advertise-client-urls http://$INTERNAL_IP:2379 -listen-client-urls http
|
|
|
fce617 |
- Publish configuration in etcd (ensure that the network range does not overlap with the one configured for the VPC)
|
|
|
fce617 |
|
|
|
fce617 |
```
|
|
|
fce617 |
-$ etcdctl set /coreos.com/network/config '{"Network":"10.20.0.0/16", "Backend": {"Type": "aws-vpc"}}'
|
|
|
fce617 |
+$ etcdctl set /atomic.io/network/config '{"Network":"10.20.0.0/16", "Backend": {"Type": "aws-vpc"}}'
|
|
|
fce617 |
```
|
|
|
fce617 |
- 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)
|
|
|
fce617 |
- Run flannel daemon:
|
|
|
fce617 |
diff --git a/Documentation/gce-backend.md b/Documentation/gce-backend.md
|
|
|
fce617 |
index 35ed8b4..675c4b0 100644
|
|
|
fce617 |
--- a/Documentation/gce-backend.md
|
|
|
fce617 |
+++ b/Documentation/gce-backend.md
|
|
|
fce617 |
@@ -44,7 +44,7 @@ $ etcd2 -advertise-client-urls http://$INTERNAL_IP:2379 -listen-client-urls http
|
|
|
fce617 |
- Publish configuration in etcd (ensure that the network range does not overlap with the one configured for the GCE network)
|
|
|
fce617 |
|
|
|
fce617 |
```
|
|
|
fce617 |
-$ etcdctl set /coreos.com/network/config '{"Network":"10.40.0.0/16", "Backend": {"Type": "gce"}}'
|
|
|
fce617 |
+$ etcdctl set /atomic.io/network/config '{"Network":"10.40.0.0/16", "Backend": {"Type": "gce"}}'
|
|
|
fce617 |
```
|
|
|
fce617 |
|
|
|
fce617 |
- 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)
|
|
|
fce617 |
diff --git a/README.md b/README.md
|
|
|
fce617 |
index 6e691c6..7b05d41 100644
|
|
|
fce617 |
--- a/README.md
|
|
|
fce617 |
+++ b/README.md
|
|
|
fce617 |
@@ -43,7 +43,7 @@ docker run -v $SRC:/opt/flannel -i -t google/golang /bin/bash -c "cd /opt/flanne
|
|
|
fce617 |
## Configuration
|
|
|
fce617 |
|
|
|
fce617 |
flannel reads its configuration from etcd.
|
|
|
fce617 |
-By default, it will read the configuration from `/coreos.com/network/config` (can be overridden via `--etcd-prefix`).
|
|
|
fce617 |
+By default, it will read the configuration from `/atomic.io/network/config` (can be overridden via `--etcd-prefix`).
|
|
|
fce617 |
You can use `etcdctl` utility to set values in etcd.
|
|
|
fce617 |
The value of the config is a JSON dictionary with the following keys:
|
|
|
fce617 |
|
|
|
fce617 |
@@ -147,9 +147,9 @@ Multi-network mode allows a single flannel daemon to join multiple networks.
|
|
|
fce617 |
Each network is independent from each other and has its own configuration, IP space, interfaces.
|
|
|
fce617 |
To configure three networks -- in this example named `blue`, `green`, and `red` -- start by publishing their configurations to etcd in different locations:
|
|
|
fce617 |
```
|
|
|
fce617 |
-$ etcdctl set /coreos.com/network/blue/config '{ "Network": "10.1.0.0/16", "Backend": { "Type": "vxlan", "VNI": 1 } }'
|
|
|
fce617 |
-$ etcdctl set /coreos.com/network/green/config '{ "Network": "10.2.0.0/16", "Backend": { "Type": "vxlan", "VNI": 2 } }'
|
|
|
fce617 |
-$ etcdctl set /coreos.com/network/red/config '{ "Network": "10.3.0.0/16", "Backend": { "Type": "vxlan", "VNI": 3 } }'
|
|
|
fce617 |
+$ etcdctl set /atomic.io/network/blue/config '{ "Network": "10.1.0.0/16", "Backend": { "Type": "vxlan", "VNI": 1 } }'
|
|
|
fce617 |
+$ etcdctl set /atomic.io/network/green/config '{ "Network": "10.2.0.0/16", "Backend": { "Type": "vxlan", "VNI": 2 } }'
|
|
|
fce617 |
+$ etcdctl set /atomic.io/network/red/config '{ "Network": "10.3.0.0/16", "Backend": { "Type": "vxlan", "VNI": 3 } }'
|
|
|
fce617 |
```
|
|
|
fce617 |
|
|
|
fce617 |
Next, start the flannel daemon, specifying the networks to join:
|
|
|
fce617 |
@@ -183,7 +183,7 @@ $ flanneld --remote=10.0.0.3:8888 --networks=blue,green
|
|
|
fce617 |
```
|
|
|
fce617 |
--public-ip="": IP accessible by other nodes for inter-host communication. Defaults to the IP of the interface being used for communication.
|
|
|
fce617 |
--etcd-endpoints=http://127.0.0.1:2379: a comma-delimited list of etcd endpoints.
|
|
|
fce617 |
---etcd-prefix=/coreos.com/network: etcd prefix.
|
|
|
fce617 |
+--etcd-prefix=/atomic.io/network: etcd prefix.
|
|
|
fce617 |
--etcd-keyfile="": SSL key file used to secure etcd communication.
|
|
|
fce617 |
--etcd-certfile="": SSL certification file used to secure etcd communication.
|
|
|
fce617 |
--etcd-cafile="": SSL Certificate Authority file used to secure etcd communication.
|
|
|
fce617 |
diff --git a/main.go b/main.go
|
|
|
fce617 |
index b6493e0..5adfb55 100644
|
|
|
fce617 |
--- a/main.go
|
|
|
fce617 |
+++ b/main.go
|
|
|
fce617 |
@@ -62,7 +62,7 @@ var opts CmdLineOpts
|
|
|
fce617 |
|
|
|
fce617 |
func init() {
|
|
|
fce617 |
flag.StringVar(&opts.etcdEndpoints, "etcd-endpoints", "http://127.0.0.1:2379", "a comma-delimited list of etcd endpoints")
|
|
|
fce617 |
- flag.StringVar(&opts.etcdPrefix, "etcd-prefix", "/coreos.com/network", "etcd prefix")
|
|
|
fce617 |
+ flag.StringVar(&opts.etcdPrefix, "etcd-prefix", "/atomic.io/network", "etcd prefix")
|
|
|
fce617 |
flag.StringVar(&opts.etcdKeyfile, "etcd-keyfile", "", "SSL key file used to secure etcd communication")
|
|
|
fce617 |
flag.StringVar(&opts.etcdCertfile, "etcd-certfile", "", "SSL certification file used to secure etcd communication")
|
|
|
fce617 |
flag.StringVar(&opts.etcdCAFile, "etcd-cafile", "", "SSL Certificate Authority file used to secure etcd communication")
|
|
|
fce617 |
diff --git a/subnet/mock_etcd_test.go b/subnet/mock_etcd_test.go
|
|
|
fce617 |
index 8927cd2..e838282 100644
|
|
|
fce617 |
--- a/subnet/mock_etcd_test.go
|
|
|
fce617 |
+++ b/subnet/mock_etcd_test.go
|
|
|
fce617 |
@@ -70,17 +70,17 @@ func watchMockEtcd(ctx context.Context, watcher etcd.Watcher, result chan error)
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
expected := []evt{
|
|
|
fce617 |
- {"/coreos.com/network/foobar/config", "create", false},
|
|
|
fce617 |
- {"/coreos.com/network/blah/config", "create", false},
|
|
|
fce617 |
- {"/coreos.com/network/blah/config", "update", false},
|
|
|
fce617 |
- {"/coreos.com/network/foobar/config", "delete", false},
|
|
|
fce617 |
- {"/coreos.com/network/foobar", "delete", false},
|
|
|
fce617 |
+ {"/atomic.io/network/foobar/config", "create", false},
|
|
|
fce617 |
+ {"/atomic.io/network/blah/config", "create", false},
|
|
|
fce617 |
+ {"/atomic.io/network/blah/config", "update", false},
|
|
|
fce617 |
+ {"/atomic.io/network/foobar/config", "delete", false},
|
|
|
fce617 |
+ {"/atomic.io/network/foobar", "delete", false},
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
- // Wait for delete events on /coreos.com/network/foobar and its
|
|
|
fce617 |
+ // Wait for delete events on /atomic.io/network/foobar and its
|
|
|
fce617 |
// 'config' child, and for the update event on
|
|
|
fce617 |
- // /coreos.com/network/foobar (for 'config' delete) and on
|
|
|
fce617 |
- // /coreos.com/network (for 'foobar' delete)
|
|
|
fce617 |
+ // /atomic.io/network/foobar (for 'config' delete) and on
|
|
|
fce617 |
+ // /atomic.io/network (for 'foobar' delete)
|
|
|
fce617 |
numEvents := 0
|
|
|
fce617 |
for {
|
|
|
fce617 |
resp, err := watcher.Next(ctx)
|
|
|
fce617 |
@@ -134,24 +134,24 @@ func TestMockEtcd(t *testing.T) {
|
|
|
fce617 |
|
|
|
fce617 |
// Create base test keys
|
|
|
fce617 |
sopts := &etcd.SetOptions{Dir: true}
|
|
|
fce617 |
- r, err = m.Set(ctx, "/coreos.com/network", "", sopts)
|
|
|
fce617 |
+ r, err = m.Set(ctx, "/atomic.io/network", "", sopts)
|
|
|
fce617 |
e = &etcd.Response{Action: "create", Index: 1002}
|
|
|
fce617 |
expectSuccess(t, r, err, e, "")
|
|
|
fce617 |
|
|
|
fce617 |
wopts := &etcd.WatcherOptions{AfterIndex: m.index, Recursive: true}
|
|
|
fce617 |
- watcher := m.Watcher("/coreos.com/network", wopts)
|
|
|
fce617 |
+ watcher := m.Watcher("/atomic.io/network", wopts)
|
|
|
fce617 |
|
|
|
fce617 |
result := make(chan error, 1)
|
|
|
fce617 |
go watchMockEtcd(ctx, watcher, result)
|
|
|
fce617 |
|
|
|
fce617 |
// Populate etcd with some keys
|
|
|
fce617 |
- netKey1 := "/coreos.com/network/foobar/config"
|
|
|
fce617 |
+ netKey1 := "/atomic.io/network/foobar/config"
|
|
|
fce617 |
netValue := "{ \"Network\": \"10.1.0.0/16\", \"Backend\": { \"Type\": \"host-gw\" } }"
|
|
|
fce617 |
r, err = m.Create(ctx, netKey1, netValue)
|
|
|
fce617 |
e = &etcd.Response{Action: "create", Index: 1004}
|
|
|
fce617 |
expectSuccess(t, r, err, e, netValue)
|
|
|
fce617 |
|
|
|
fce617 |
- netKey2 := "/coreos.com/network/blah/config"
|
|
|
fce617 |
+ netKey2 := "/atomic.io/network/blah/config"
|
|
|
fce617 |
netValue = "{ \"Network\": \"10.1.1.0/16\", \"Backend\": { \"Type\": \"host-gw\" } }"
|
|
|
fce617 |
r, err = m.Create(ctx, netKey2, netValue)
|
|
|
fce617 |
e = &etcd.Response{Action: "create", Index: 1006}
|
|
|
fce617 |
@@ -178,7 +178,7 @@ func TestMockEtcd(t *testing.T) {
|
|
|
fce617 |
|
|
|
fce617 |
// test directory listing
|
|
|
fce617 |
opts = &etcd.GetOptions{Recursive: true, Quorum: true}
|
|
|
fce617 |
- r, err = m.Get(ctx, "/coreos.com/network/", opts)
|
|
|
fce617 |
+ r, err = m.Get(ctx, "/atomic.io/network/", opts)
|
|
|
fce617 |
e = &etcd.Response{Action: "get", Index: 1007}
|
|
|
fce617 |
expectSuccess(t, r, err, e, "")
|
|
|
fce617 |
|
|
|
fce617 |
@@ -191,9 +191,9 @@ func TestMockEtcd(t *testing.T) {
|
|
|
fce617 |
if child.Dir != true {
|
|
|
fce617 |
t.Fatalf("Unexpected non-directory child %s", child.Key)
|
|
|
fce617 |
}
|
|
|
fce617 |
- if child.Key == "/coreos.com/network/foobar" {
|
|
|
fce617 |
+ if child.Key == "/atomic.io/network/foobar" {
|
|
|
fce617 |
node1Found = true
|
|
|
fce617 |
- } else if child.Key == "/coreos.com/network/blah" {
|
|
|
fce617 |
+ } else if child.Key == "/atomic.io/network/blah" {
|
|
|
fce617 |
node2Found = true
|
|
|
fce617 |
} else {
|
|
|
fce617 |
t.Fatalf("Unexpected child %s found", child.Key)
|
|
|
fce617 |
@@ -208,14 +208,14 @@ func TestMockEtcd(t *testing.T) {
|
|
|
fce617 |
|
|
|
fce617 |
// Delete a key
|
|
|
fce617 |
dopts := &etcd.DeleteOptions{Recursive: true, Dir: false}
|
|
|
fce617 |
- r, err = m.Delete(ctx, "/coreos.com/network/foobar", dopts)
|
|
|
fce617 |
+ r, err = m.Delete(ctx, "/atomic.io/network/foobar", dopts)
|
|
|
fce617 |
if err == nil {
|
|
|
fce617 |
t.Fatalf("Unexpected success deleting a directory")
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
// Delete a key
|
|
|
fce617 |
dopts = &etcd.DeleteOptions{Recursive: true, Dir: true}
|
|
|
fce617 |
- r, err = m.Delete(ctx, "/coreos.com/network/foobar", dopts)
|
|
|
fce617 |
+ r, err = m.Delete(ctx, "/atomic.io/network/foobar", dopts)
|
|
|
fce617 |
e = &etcd.Response{Action: "delete", Index: 1010}
|
|
|
fce617 |
expectSuccess(t, r, err, e, "")
|
|
|
fce617 |
|
|
|
fce617 |
diff --git a/subnet/registry.go b/subnet/registry.go
|
|
|
fce617 |
index dd8083b..42cbfb0 100644
|
|
|
fce617 |
--- a/subnet/registry.go
|
|
|
fce617 |
+++ b/subnet/registry.go
|
|
|
fce617 |
@@ -384,7 +384,7 @@ func (esr *etcdSubnetRegistry) parseNetworkWatchResponse(resp *etcd.Response) (E
|
|
|
fce617 |
return evt, index, nil
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
-// Returns network name from config key (eg, /coreos.com/network/foobar/config),
|
|
|
fce617 |
+// Returns network name from config key (eg, /atomic.io/network/foobar/config),
|
|
|
fce617 |
// if the 'config' key isn't present we don't consider the network valid
|
|
|
fce617 |
func (esr *etcdSubnetRegistry) parseNetworkKey(s string) (string, bool) {
|
|
|
fce617 |
if parts := esr.networkRegex.FindStringSubmatch(s); len(parts) == 3 {
|
|
|
fce617 |
diff --git a/subnet/registry_test.go b/subnet/registry_test.go
|
|
|
fce617 |
index 8d7524f..4c64423 100644
|
|
|
fce617 |
--- a/subnet/registry_test.go
|
|
|
fce617 |
+++ b/subnet/registry_test.go
|
|
|
fce617 |
@@ -29,7 +29,7 @@ import (
|
|
|
fce617 |
func newTestEtcdRegistry(t *testing.T) (Registry, *mockEtcd) {
|
|
|
fce617 |
cfg := &EtcdConfig{
|
|
|
fce617 |
Endpoints: []string{"http://127.0.0.1:4001", "http://127.0.0.1:2379"},
|
|
|
fce617 |
- Prefix: "/coreos.com/network",
|
|
|
fce617 |
+ Prefix: "/atomic.io/network",
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
r, err := newEtcdSubnetRegistry(cfg, func(c *EtcdConfig) (etcd.KeysAPI, error) {
|
|
|
fce617 |
@@ -105,7 +105,7 @@ func TestEtcdRegistry(t *testing.T) {
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
// Populate etcd with a network
|
|
|
fce617 |
- netKey := "/coreos.com/network/foobar/config"
|
|
|
fce617 |
+ netKey := "/atomic.io/network/foobar/config"
|
|
|
fce617 |
netValue := "{ \"Network\": \"10.1.0.0/16\", \"Backend\": { \"Type\": \"host-gw\" } }"
|
|
|
fce617 |
m.Create(ctx, netKey, netValue)
|
|
|
fce617 |
|
|
|
fce617 |
@@ -155,7 +155,7 @@ func TestEtcdRegistry(t *testing.T) {
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
// Make sure the lease got created
|
|
|
fce617 |
- resp, err := m.Get(ctx, "/coreos.com/network/foobar/subnets/10.1.5.0-24", nil)
|
|
|
fce617 |
+ resp, err := m.Get(ctx, "/atomic.io/network/foobar/subnets/10.1.5.0-24", nil)
|
|
|
fce617 |
if err != nil {
|
|
|
fce617 |
t.Fatal("Failed to verify subnet lease directly in etcd: %v", err)
|
|
|
fce617 |
}
|
|
|
fce617 |
@@ -185,7 +185,7 @@ func TestEtcdRegistry(t *testing.T) {
|
|
|
fce617 |
}
|
|
|
fce617 |
|
|
|
fce617 |
// Make sure the lease got deleted
|
|
|
fce617 |
- resp, err = m.Get(ctx, "/coreos.com/network/foobar/subnets/10.1.5.0-24", nil)
|
|
|
fce617 |
+ resp, err = m.Get(ctx, "/atomic.io/network/foobar/subnets/10.1.5.0-24", nil)
|
|
|
fce617 |
if err == nil {
|
|
|
fce617 |
t.Fatal("Unexpected success getting deleted subnet")
|
|
|
fce617 |
}
|
|
|
fce617 |
--
|
|
|
fce617 |
2.7.4
|
|
|
fce617 |
|