Hi Simon,

On Mon, May 16, 2022 at 01:20:44PM +0100, Simon McVittie wrote:
> On Mon, 16 May 2022 at 11:58:16 +0100, Julian Gilbey wrote:
> > The autopkgtest-build-lxc script searches for a bridge interface as
> > follows:
> > 
> >             local bridge_interface=$(awk '{ if ($1 == "lxc.network.link") 
> > print($3)}' /etc/lxc/default.conf)
> 
> You haven't said what user-visible problem is caused by not finding this.
> Am I correct in thinking that the answer is: if the host system's apt
> proxy is localhost or 127.0.0.x, then it will not be converted into
> the bridge address for propagation into the container, and the container
> will end up not using a proxy?

Oh yes, I should have said this: that is indeed the problem.  (Well
deduced!)

> > Perhaps the code could be modified to something like:
> > 
> >             local bridge_interface=$(awk '{ if ($1 == "lxc.network.link" || 
> > $1 == "lxc.net.0.link") print($3)}' /etc/lxc/default.conf)
> 
> If you do that, does it solve the user-visible problem?

Yes, it does, but having a look at /usr/bin/lxc-update-config, I see
that the "0" in this is not necessarily always correct; it could be
any number.  So perhaps something more like:

local bridge_interface=$(awk '/lxc\.net(work|\.[0-9]+)\.link/ {print($3)}' 
/etc/lxc/default.conf)

would be better?

Best wishes,

   Julian

Reply via email to