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