public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] applied: [PATCH container 4/5] alpine: setup net: pass whole config to parent method
Date: Wed,  9 Sep 2020 21:12:22 +0200	[thread overview]
Message-ID: <20200909191223.4187564-4-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20200909191223.4187564-1-t.lamprecht@proxmox.com>

We expected the whole $conf to be passed in a call to setup_network,
a bit ago it worked if their where only the netX keys present, for
some plugin that still is the case.
But, in the Debian version, reused by Alpine, we now check if the CT
distro version is recent enough to support (or need) the address in
CIDR format.
So, at least "ostype" needs to be passed to, else we get ugly
warnings in the syslog (or the recently added --debug log CLI switch)

Just pass the whole config, the setup_network method need to cope
with that anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 src/PVE/LXC/Setup/Alpine.pm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/PVE/LXC/Setup/Alpine.pm b/src/PVE/LXC/Setup/Alpine.pm
index 75d6ebe..e486971 100644
--- a/src/PVE/LXC/Setup/Alpine.pm
+++ b/src/PVE/LXC/Setup/Alpine.pm
@@ -86,21 +86,24 @@ sub setup_network {
     # at least with the workaround the networking starts and if an ipv4 is
     # configured slaac for ipv6 works (unless accept_ra = 0 in the node)
 
-    my $netconf = {};
+    my $newconf = {};
     my $networks = {};
     foreach my $k (keys %$conf) {
+	my $value = $conf->{$k};
+	$newconf->{$k} = $value;
 	next if $k !~ m/^net(\d+)$/;
-	my $netstring = $conf->{$k};
+
+	my $netstring = $value;
 	# check for dhcp6:
 	my $d = PVE::LXC::Config->parse_lxc_network($netstring);
 	if (defined($d->{ip6}) && ($d->{ip6} eq 'dhcp' || $d->{ip6} eq 'auto')) {
 	    $d->{ip6} = 'manual';
 	    $netstring = PVE::LXC::Config->print_lxc_network($d);
 	}
-	$netconf->{$k} = $netstring;
+	$newconf->{$k} = $netstring;
     }
 
-    PVE::LXC::Setup::Debian::setup_network($self, $netconf);
+    PVE::LXC::Setup::Debian::setup_network($self, $newconf);
 }
 
 1;
-- 
2.20.1





  parent reply	other threads:[~2020-09-09 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 19:12 [pve-devel] applied: [PATCH container 1/5] ct start: track lxc-start stderr and print in error case Thomas Lamprecht
2020-09-09 19:12 ` [pve-devel] applied: [PATCH container 2/5] implement debug start Thomas Lamprecht
2020-09-09 19:12 ` [pve-devel] applied: [PATCH container 3/5] protected_call: remove left-over rootdir/dev mkdir Thomas Lamprecht
2020-09-09 19:12 ` Thomas Lamprecht [this message]
2020-09-09 19:12 ` [pve-devel] applied: [PATCH container 5/5] setup: heuristically warn if the FS hosting /etc is not mounted Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200909191223.4187564-4-t.lamprecht@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal