7 type NetDevConfig map[string]interface{}
8 type ContainerConfig map[string]interface{}
9 type VolumeConfig map[string]interface{}
11 type YamlTopology struct {
12 Devices []NetDevConfig `yaml:"devices"`
13 Containers []ContainerConfig `yaml:"containers"`
14 Volumes []VolumeConfig `yaml:"volumes"`
17 func AddAddress(device, address, ns string) error {
18 c := []string{"ip", "addr", "add", address, "dev", device}
19 cmd := appendNetns(c, ns)
22 return fmt.Errorf("failed to set ip address for %s: %v", device, err)