mirror of
https://github.com/linka-cloud/d2vm.git
synced 2026-01-24 02:25:04 +00:00
feat: add --dns and --dns-search flags to customize the vm dns configuration
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@@ -35,7 +35,9 @@ type convertOptions struct {
|
||||
platform string
|
||||
pull bool
|
||||
|
||||
hostname string
|
||||
hostname string
|
||||
dns []string
|
||||
dnsSearch []string
|
||||
}
|
||||
|
||||
func (o *convertOptions) hasGrubBIOS() bool {
|
||||
@@ -135,3 +137,15 @@ func WithHostname(hostname string) ConvertOption {
|
||||
o.hostname = hostname
|
||||
}
|
||||
}
|
||||
|
||||
func WithDNS(dns []string) ConvertOption {
|
||||
return func(o *convertOptions) {
|
||||
o.dns = dns
|
||||
}
|
||||
}
|
||||
|
||||
func WithDNSSearch(dnsSearch []string) ConvertOption {
|
||||
return func(o *convertOptions) {
|
||||
o.dnsSearch = dnsSearch
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user