Skip to content

Commit

Permalink
Revert adding of forward device parameter for networks
Browse files Browse the repository at this point in the history
(Pull request #725 from Xachman/add_forward_dev)

This reverts commit db587ad, reversing
changes made to 883978b.

This feature will be discussed again.
  • Loading branch information
dmacvicar committed Nov 8, 2020
1 parent 2b70dcf commit 67f4f2a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
3 changes: 0 additions & 3 deletions libvirt/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 1 addition & 4 deletions libvirt/network_def_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestNetworkDefUnmarshall(t *testing.T) {
<bridge name="virbr0" stp="on" delay="5" macTableManager="libvirt"/>
<mac address='00:16:3E:5D:C7:9E'/>
<domain name="example.com" localOnly="no"/>
<forward mode='nat' dev='eth0'>
<forward mode='nat'>
<nat>
<address start='1.2.3.4' end='1.2.3.10'/>
</nat>
Expand Down Expand Up @@ -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)
}
Expand Down
6 changes: 0 additions & 6 deletions libvirt/resource_libvirt_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {

Expand Down
4 changes: 0 additions & 4 deletions website/docs/r/network.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 67f4f2a

Please sign in to comment.