lxc / go-lxc

Go bindings for liblxc
https://linuxcontainers.org/lxc
Other
431 stars 76 forks source link

ConfigItem not returning lxc.network values #37

Closed sigmonsays closed 9 years ago

sigmonsays commented 9 years ago

Given the container configuration snippet lxc.network.type = veth lxc.network.link = lxcbr0 lxc.network.flags = up lxc.network.hwaddr = 00:16:3e:xx:xx:xx

The following go code does not function as expected

container := lxc.NewContainer("example", lxc.DefaultConfigPath()) container.ConfigItem("lxc.network") returns "veth" container.ConfigItem("lxc.network.type") returns []string{""}

expected results are for lxc.network to return nothing or all lxc.network configuration. expected results are for lxc.network.type to return "veth"

latest go-lxc (commit 4c6cb39f385e62ce1f4d1042e159e332856204b7) using daily ppa package, version liblxc1 1.1.0+master~20150224-0137-0ubuntu1~precise

syed commented 9 years ago

+1

syed commented 9 years ago

After a bit of debugging I found that using lxc.network.0.link works. Was the an old method to address network args? If not, this change should go in the lxc library?

syed commented 9 years ago

Have a PR for this at https://github.com/lxc/lxc/pull/491

caglar10ur commented 9 years ago

Perfect, thank you so much tracking this down @syed. I'll close this and comment your PR on LXC side.