Permalink
Browse files

Vmware-guestinfo: add variable to set DNS search domain

  • Loading branch information...
JrCs committed Jun 13, 2016
1 parent 80cab68 commit 4d2b59d5c5f54022823e5df880934d86345bfa2e
Showing with 12 additions and 1 deletion.
  1. +2 −1 Documentation/vmware-guestinfo.md
  2. +6 −0 datasource/vmware/vmware.go
  3. +4 −0 network/vmware_test.go
@@ -21,11 +21,12 @@ property names are prefixed with `guestinfo.` in the VMX, e.g., `guestinfo.hostn
| `interface.<n>.route.<l>.gateway` | `IP address` |
| `interface.<n>.route.<l>.destination` | `CIDR IP address` |
| `dns.server.<x>` | `IP address` |
| `dns.domain.<y>` | `DNS search domain` |
| `coreos.config.data` | `string` |
| `coreos.config.data.encoding` | `{"", "base64", "gzip+base64"}` |
| `coreos.config.url` | `URL` |
Note: "n", "m", "l", and "x" are 0-indexed, incrementing integers. The
Note: "n", "m", "l", "x" and "y" are 0-indexed, incrementing integers. The
identifier for an `interface` does not correspond to anything outside of this
configuration; it serves only to distinguish between multiple `interface`s.
@@ -58,6 +58,12 @@ func (v vmware) FetchMetadata() (metadata datasource.Metadata, err error) {
}
}
for i := 0; ; i++ {
if domain := saveConfig("dns.domain.%d", i); domain == "" {
break
}
}
found := true
for i := 0; found; i++ {
found = false
View
@@ -98,6 +98,8 @@ func TestProcessVMwareNetconf(t *testing.T) {
config: map[string]string{
"dns.server.0": "1.2.3.4",
"dns.server.1": "5.6.7.8",
"dns.domain.0": "coreos.com",
"dns.domain.1": "example.com",
"interface.0.mac": "00:11:22:33:44:55",
"interface.0.ip.0.address": "10.0.0.100/24",
"interface.0.ip.1.address": "10.0.0.101/24",
@@ -124,6 +126,7 @@ func TestProcessVMwareNetconf(t *testing.T) {
gateway: net.ParseIP("10.0.0.1")},
},
nameservers: []net.IP{net.ParseIP("1.2.3.4"), net.ParseIP("5.6.7.8")},
domains: []string{"coreos.com", "example.com"},
},
}},
&physicalInterface{logicalInterface{
@@ -135,6 +138,7 @@ func TestProcessVMwareNetconf(t *testing.T) {
gateway: net.ParseIP("10.0.1.1")},
},
nameservers: []net.IP{net.ParseIP("1.2.3.4"), net.ParseIP("5.6.7.8")},
domains: []string{"coreos.com", "example.com"},
},
}},
&physicalInterface{logicalInterface{

0 comments on commit 4d2b59d

Please sign in to comment.