From 67f4f2aaa7958b3a179f63b7d2604deb824d675a Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Sun, 8 Nov 2020 14:54:36 +0100 Subject: [PATCH] Revert adding of forward device parameter for networks (Pull request #725 from Xachman/add_forward_dev) This reverts commit db587ad14bfb29aa9cbd56482c79f414e2f26409, reversing changes made to 883978bdb3713e5a219b16e17579222b3d54a025. This feature will be discussed again. --- libvirt/network.go | 3 --- libvirt/network_def_test.go | 5 +---- libvirt/resource_libvirt_network.go | 6 ------ website/docs/r/network.markdown | 4 ---- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/libvirt/network.go b/libvirt/network.go index f0c342e99..13099c548 100644 --- a/libvirt/network.go +++ b/libvirt/network.go @@ -43,9 +43,6 @@ func getNetModeFromResource(d *schema.ResourceData) string { return strings.ToLower(d.Get("mode").(string)) } -func getNetDevFromResource(d *schema.ResourceData) string { - return strings.ToLower(d.Get("dev").(string)) -} // getIPsFromResource gets the IPs configurations from the resource definition func getIPsFromResource(d *schema.ResourceData) ([]libvirtxml.NetworkIP, error) { addresses, ok := d.GetOk("addresses") diff --git a/libvirt/network_def_test.go b/libvirt/network_def_test.go index df0243038..3251448ba 100644 --- a/libvirt/network_def_test.go +++ b/libvirt/network_def_test.go @@ -32,7 +32,7 @@ func TestNetworkDefUnmarshall(t *testing.T) { - +
@@ -72,9 +72,6 @@ func TestNetworkDefUnmarshall(t *testing.T) { if b.Forward.Mode != "nat" { t.Errorf("wrong forward mode: '%s'", b.Forward.Mode) } - if b.Forward.Dev != "eth0" { - t.Errorf("wrong forward dev: '%s'", b.Forward.Dev) - } if len(b.Forward.NAT.Addresses) == 0 { t.Errorf("wrong number of addresses: %s", b.Forward.NAT.Addresses) } diff --git a/libvirt/resource_libvirt_network.go b/libvirt/resource_libvirt_network.go index 7df96997f..f4ae45b32 100644 --- a/libvirt/resource_libvirt_network.go +++ b/libvirt/resource_libvirt_network.go @@ -66,11 +66,6 @@ func resourceLibvirtNetwork() *schema.Resource { ForceNew: true, Default: netModeNat, }, - "dev": { // device for forward - Type: schema.TypeString, - Optional: true, - ForceNew: false, - }, "bridge": { Type: schema.TypeString, Optional: true, @@ -372,7 +367,6 @@ func resourceLibvirtNetworkCreate(d *schema.ResourceData, meta interface{}) erro // check the network mode networkDef.Forward = &libvirtxml.NetworkForward{ Mode: getNetModeFromResource(d), - Dev: getNetDevFromResource(d), } if networkDef.Forward.Mode == netModeIsolated || networkDef.Forward.Mode == netModeNat || networkDef.Forward.Mode == netModeRoute { diff --git a/website/docs/r/network.markdown b/website/docs/r/network.markdown index 69fe46c8f..27819ecf7 100644 --- a/website/docs/r/network.markdown +++ b/website/docs/r/network.markdown @@ -20,10 +20,6 @@ resource "libvirt_network" "kube_network" { # mode can be: "nat" (default), "none", "route", "bridge" mode = "nat" - - # (optional) the network device for forward - # should be the network device or bridge. prevents talk between nat networks - # dev = "eth0" # the domain used by the DNS server in this network domain = "k8s.local"