github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/container/factory/network.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package factory 5 6 import ( 7 "github.com/juju/juju/container" 8 "github.com/juju/juju/instance" 9 ) 10 11 // DefaultNetworkBridge returns the correct network device name for the 12 // given container type. If there isn't a correct name or the type is 13 // unknown then an empty string is returned. 14 func DefaultNetworkBridge(cType instance.ContainerType) string { 15 switch cType { 16 case instance.LXD: 17 return container.DefaultLxcBridge 18 case instance.KVM: 19 return container.DefaultKvmBridge 20 default: 21 return "" 22 } 23 }