Skip to content

Commit db33890

Browse files
committed
CopyToHost is a known property
Signed-off-by: Hiroaki Takano <[email protected]>
1 parent cac97ed commit db33890

File tree

2 files changed

+57
-49
lines changed

2 files changed

+57
-49
lines changed

pkg/vz/vz_driver_darwin.go

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,39 @@ import (
1919
"github.com/lima-vm/lima/pkg/reflectutil"
2020
)
2121

22+
var knownYamlProperties = []string{
23+
"AdditionalDisks",
24+
"Arch",
25+
"Audio",
26+
"CACertificates",
27+
"Containerd",
28+
"CopyToHost",
29+
"CPUs",
30+
"CPUType",
31+
"Disk",
32+
"DNS",
33+
"Env",
34+
"Firmware",
35+
"GuestInstallPrefix",
36+
"HostResolver",
37+
"Images",
38+
"Memory",
39+
"Message",
40+
"Mounts",
41+
"MountType",
42+
"Networks",
43+
"OS",
44+
"Plain",
45+
"PortForwards",
46+
"Probes",
47+
"PropagateProxyEnv",
48+
"Provision",
49+
"Rosetta",
50+
"SSH",
51+
"Video",
52+
"VMType",
53+
}
54+
2255
const Enabled = true
2356

2457
type LimaVzDriver struct {
@@ -45,36 +78,7 @@ func (l *LimaVzDriver) Validate() error {
4578
if *l.Yaml.Firmware.LegacyBIOS {
4679
return fmt.Errorf("`firmware.legacyBIOS` configuration is not supported for VZ driver")
4780
}
48-
if unknown := reflectutil.UnknownNonEmptyFields(l.Yaml, "VMType",
49-
"Arch",
50-
"Images",
51-
"CPUs",
52-
"CPUType",
53-
"Memory",
54-
"Disk",
55-
"Mounts",
56-
"MountType",
57-
"SSH",
58-
"Firmware",
59-
"Provision",
60-
"Containerd",
61-
"GuestInstallPrefix",
62-
"Probes",
63-
"PortForwards",
64-
"Message",
65-
"Networks",
66-
"Env",
67-
"DNS",
68-
"HostResolver",
69-
"PropagateProxyEnv",
70-
"CACertificates",
71-
"Rosetta",
72-
"AdditionalDisks",
73-
"Audio",
74-
"Video",
75-
"OS",
76-
"Plain",
77-
); len(unknown) > 0 {
81+
if unknown := reflectutil.UnknownNonEmptyFields(l.Yaml, knownYamlProperties...); len(unknown) > 0 {
7882
logrus.Warnf("vmType %s: ignoring %+v", *l.Yaml.VMType, unknown)
7983
}
8084

pkg/wsl2/wsl_driver_windows.go

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@ import (
1414
"github.com/sirupsen/logrus"
1515
)
1616

17+
var knownYamlProperties = []string{
18+
"Arch",
19+
"Containerd",
20+
"CopyToHost",
21+
"CPUType",
22+
"Disk",
23+
"DNS",
24+
"Env",
25+
"HostResolver",
26+
"Images",
27+
"Message",
28+
"Mounts",
29+
"MountType",
30+
"Plain",
31+
"PortForwards",
32+
"Probes",
33+
"PropagateProxyEnv",
34+
"Provision",
35+
"SSH",
36+
"VMType",
37+
}
38+
1739
const Enabled = true
1840

1941
type LimaWslDriver struct {
@@ -31,25 +53,7 @@ func (l *LimaWslDriver) Validate() error {
3153
return fmt.Errorf("field `mountType` must be %q for WSL2 driver, got %q", limayaml.WSLMount, *l.Yaml.MountType)
3254
}
3355
// TODO: revise this list for WSL2
34-
if unknown := reflectutil.UnknownNonEmptyFields(l.Yaml, "VMType",
35-
"Arch",
36-
"Images",
37-
"CPUType",
38-
"Disk",
39-
"Mounts",
40-
"MountType",
41-
"SSH",
42-
"Provision",
43-
"Containerd",
44-
"Probes",
45-
"PortForwards",
46-
"Message",
47-
"Env",
48-
"DNS",
49-
"HostResolver",
50-
"PropagateProxyEnv",
51-
"Plain",
52-
); len(unknown) > 0 {
56+
if unknown := reflectutil.UnknownNonEmptyFields(l.Yaml, knownYamlProperties...); len(unknown) > 0 {
5357
logrus.Warnf("Ignoring: vmType %s: %+v", *l.Yaml.VMType, unknown)
5458
}
5559

0 commit comments

Comments
 (0)