Move bridge-creation code from weave script into Go code
via weaveutil create-bridge function
This commit is contained in:
1 parent
6fd9f471ff
commit
8051f51d46
5 files changed
+115
-195
No files matched your search
+17
-2
@@ -28,6 +28,23 @@ const (
|
||||
Inconsistent
|
||||
)
|
||||
|
||||
// Returns a string that is consistent with the weave script
|
||||
func (t BridgeType) String() string {
|
||||
switch t {
|
||||
case None:
|
||||
return "none"
|
||||
case Bridge:
|
||||
return "bridge"
|
||||
case Fastdp:
|
||||
return "fastdp"
|
||||
case BridgedFastdp:
|
||||
return "bridged_fastdp"
|
||||
case Inconsistent:
|
||||
return "inconsistent"
|
||||
}
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
func DetectBridgeType(weaveBridgeName, datapathName string) BridgeType {
|
||||
bridge, _ := netlink.LinkByName(weaveBridgeName)
|
||||
datapath, _ := netlink.LinkByName(datapathName)
|
||||
@@ -151,8 +168,6 @@ func FindBridgeIP(bridgeName string, subnet *net.IPNet) (net.IP, error) {
|
||||
}
|
||||
|
||||
type BridgeConfig struct {
|
||||
DBPrefix string
|
||||
HostRoot string
|
||||
DockerBridgeName string
|
||||
WeaveBridgeName string
|
||||
DatapathName string
|
||||
|
||||
Reference in new issue
Block a user