mirror of
https://github.com/linka-cloud/d2vm.git
synced 2026-01-24 02:25:04 +00:00
feat: add --add-host flag to customize host-to-IP mapping in /etc/hosts
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@@ -38,6 +38,7 @@ type convertOptions struct {
|
||||
hostname string
|
||||
dns []string
|
||||
dnsSearch []string
|
||||
hosts map[string]string
|
||||
}
|
||||
|
||||
func (o *convertOptions) hasGrubBIOS() bool {
|
||||
@@ -149,3 +150,9 @@ func WithDNSSearch(dnsSearch []string) ConvertOption {
|
||||
o.dnsSearch = dnsSearch
|
||||
}
|
||||
}
|
||||
|
||||
func WithExtraHosts(hosts map[string]string) ConvertOption {
|
||||
return func(o *convertOptions) {
|
||||
o.hosts = hosts
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user