|
@@ -30,9 +30,10 @@ func TestAddStackLabel(t *testing.T) {
|
|
func TestNetworks(t *testing.T) {
|
|
func TestNetworks(t *testing.T) {
|
|
namespace := Namespace{name: "foo"}
|
|
namespace := Namespace{name: "foo"}
|
|
serviceNetworks := map[string]struct{}{
|
|
serviceNetworks := map[string]struct{}{
|
|
- "normal": {},
|
|
|
|
- "outside": {},
|
|
|
|
- "default": {},
|
|
|
|
|
|
+ "normal": {},
|
|
|
|
+ "outside": {},
|
|
|
|
+ "default": {},
|
|
|
|
+ "attachablenet": {},
|
|
}
|
|
}
|
|
source := networkMap{
|
|
source := networkMap{
|
|
"normal": composetypes.NetworkConfig{
|
|
"normal": composetypes.NetworkConfig{
|
|
@@ -58,6 +59,10 @@ func TestNetworks(t *testing.T) {
|
|
Name: "special",
|
|
Name: "special",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ "attachablenet": composetypes.NetworkConfig{
|
|
|
|
+ Driver: "overlay",
|
|
|
|
+ Attachable: true,
|
|
|
|
+ },
|
|
}
|
|
}
|
|
expected := map[string]types.NetworkCreate{
|
|
expected := map[string]types.NetworkCreate{
|
|
"default": {
|
|
"default": {
|
|
@@ -83,6 +88,13 @@ func TestNetworks(t *testing.T) {
|
|
"something": "labeled",
|
|
"something": "labeled",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ "attachablenet": {
|
|
|
|
+ Driver: "overlay",
|
|
|
|
+ Attachable: true,
|
|
|
|
+ Labels: map[string]string{
|
|
|
|
+ LabelNamespace: "foo",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
}
|
|
}
|
|
|
|
|
|
networks, externals := Networks(namespace, source, serviceNetworks)
|
|
networks, externals := Networks(namespace, source, serviceNetworks)
|