Improve veth name construction; use a constant instead of "ethwe"
This commit is contained in:
1 parent
8717fd15ed
commit
2702b85ee5
5 files changed
+14
-8
No files matched your search
@@ -40,7 +40,7 @@ func attach(args []string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = weavenet.AttachContainer(nsContainer, fmt.Sprint(pid), "ethwe", args[1], mtu, withMulticastRoute, cidrs)
|
||||
err = weavenet.AttachContainer(nsContainer, fmt.Sprint(pid), weavenet.VethName, args[1], mtu, withMulticastRoute, cidrs)
|
||||
// If we detected an error but the container has died, tell the user that instead.
|
||||
if err != nil && !processExists(pid) {
|
||||
err = fmt.Errorf("Container %s died", args[0])
|
||||
@@ -97,5 +97,5 @@ func detach(args []string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return weavenet.DetachContainer(ns, args[0], "ethwe", cidrs)
|
||||
return weavenet.DetachContainer(ns, args[0], weavenet.VethName, cidrs)
|
||||
}
|
||||
@@ -7,6 +7,6 @@ import (
|
||||
)
|
||||
|
||||
func checkNetwork() error {
|
||||
_, err := weavenet.EnsureInterface("ethwe")
|
||||
_, err := weavenet.EnsureInterface(weavenet.VethName)
|
||||
return err
|
||||
}
|
||||
@@ -7,6 +7,6 @@ import (
|
||||
)
|
||||
|
||||
func checkNetwork() error {
|
||||
_, err := weavenet.EnsureInterfaceAndMcastRoute("ethwe")
|
||||
_, err := weavenet.EnsureInterfaceAndMcastRoute(weavenet.VethName)
|
||||
return err
|
||||
}
|
||||
Reference in new issue
Block a user