2
0
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:
2026-01-21 17:23:57 +01:00
parent f799dc4891
commit 0ecdf57a6a
9 changed files with 58 additions and 6 deletions

View File

@@ -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
}
}