The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/distrobuilder/pull/325

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 89bb2241445eb26927884b9c37a9a9bb25938031 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Mon, 20 Apr 2020 16:51:44 -0400
Subject: [PATCH] cloud-init: Update for virtual machines
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 generators/cloud-init.go      | 2 +-
 generators/cloud-init_test.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/generators/cloud-init.go b/generators/cloud-init.go
index 46c7468..b2bd017 100644
--- a/generators/cloud-init.go
+++ b/generators/cloud-init.go
@@ -123,7 +123,7 @@ local-hostname: {{ container.name }}
                content = `{% if config_get("user.network-config", "") == "" 
%}version: 1
 config:
   - type: physical
-    name: eth0
+    name: {% if instance.type == "virtual-machine" %}enp5s0{% else %}eth0{% 
endif %}
     subnets:
       - type: {% if config_get("user.network_mode", "") == "link-local" 
%}manual{% else %}dhcp{% endif %}
         control: auto{% else %}{{ config_get("user.network-config", "") }}{% 
endif %}
diff --git a/generators/cloud-init_test.go b/generators/cloud-init_test.go
index 06ce41a..47d92f6 100644
--- a/generators/cloud-init_test.go
+++ b/generators/cloud-init_test.go
@@ -122,7 +122,7 @@ local-hostname: {{ container.name }}
                        `{% if config_get("user.network-config", "") == "" 
%}version: 1
 config:
   - type: physical
-    name: eth0
+    name: {% if instance.type == "virtual-machine" %}enp5s0{% else %}eth0{% 
endif %}
     subnets:
       - type: {% if config_get("user.network_mode", "") == "link-local" 
%}manual{% else %}dhcp{% endif %}
         control: auto{% else %}{{ config_get("user.network-config", "") }}{% 
endif %}
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to