@@ -284,7 +284,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
284
284
}
285
285
y .Arch = ptr .Of (ResolveArch (y .Arch ))
286
286
287
- y .Images = append ( append ( o .Images , y .Images ... ) , d .Images ... )
287
+ y .Images = slices . Concat ( o .Images , y .Images , d .Images )
288
288
for i := range y .Images {
289
289
img := & y .Images [i ]
290
290
if img .Arch == "" {
@@ -352,7 +352,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
352
352
y .Disk = ptr .Of (defaultDiskSizeAsString ())
353
353
}
354
354
355
- y .AdditionalDisks = append ( append ( o .AdditionalDisks , y .AdditionalDisks ... ) , d .AdditionalDisks ... )
355
+ y .AdditionalDisks = slices . Concat ( o .AdditionalDisks , y .AdditionalDisks , d .AdditionalDisks )
356
356
357
357
if y .Audio .Device == nil {
358
358
y .Audio .Device = d .Audio .Device
@@ -394,7 +394,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
394
394
y .Firmware .LegacyBIOS = ptr .Of (false )
395
395
}
396
396
397
- y .Firmware .Images = append ( append ( o .Firmware .Images , y .Firmware .Images ... ) , d .Firmware .Images ... )
397
+ y .Firmware .Images = slices . Concat ( o .Firmware .Images , y .Firmware .Images , d .Firmware .Images )
398
398
for i := range y .Firmware .Images {
399
399
f := & y .Firmware .Images [i ]
400
400
if f .Arch == "" {
@@ -475,7 +475,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
475
475
}
476
476
y .HostResolver .Hosts = hosts
477
477
478
- y .Provision = append ( append ( o .Provision , y .Provision ... ) , d .Provision ... )
478
+ y .Provision = slices . Concat ( o .Provision , y .Provision , d .Provision )
479
479
for i := range y .Provision {
480
480
provision := & y .Provision [i ]
481
481
if provision .Mode == "" {
@@ -535,7 +535,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
535
535
}
536
536
}
537
537
538
- y .Containerd .Archives = append ( append ( o .Containerd .Archives , y .Containerd .Archives ... ) , d .Containerd .Archives ... )
538
+ y .Containerd .Archives = slices . Concat ( o .Containerd .Archives , y .Containerd .Archives , d .Containerd .Archives )
539
539
if len (y .Containerd .Archives ) == 0 {
540
540
y .Containerd .Archives = defaultContainerdArchives ()
541
541
}
@@ -546,7 +546,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
546
546
}
547
547
}
548
548
549
- y .Probes = append ( append ( o .Probes , y .Probes ... ) , d .Probes ... )
549
+ y .Probes = slices . Concat ( o .Probes , y .Probes , d .Probes )
550
550
for i := range y .Probes {
551
551
probe := & y .Probes [i ]
552
552
if probe .Mode == "" {
@@ -562,13 +562,13 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
562
562
}
563
563
}
564
564
565
- y .PortForwards = append ( append ( o .PortForwards , y .PortForwards ... ) , d .PortForwards ... )
565
+ y .PortForwards = slices . Concat ( o .PortForwards , y .PortForwards , d .PortForwards )
566
566
for i := range y .PortForwards {
567
567
FillPortForwardDefaults (& y .PortForwards [i ], instDir , y .User , y .Param )
568
568
// After defaults processing the singular HostPort and GuestPort values should not be used again.
569
569
}
570
570
571
- y .CopyToHost = append ( append ( o .CopyToHost , y .CopyToHost ... ) , d .CopyToHost ... )
571
+ y .CopyToHost = slices . Concat ( o .CopyToHost , y .CopyToHost , d .CopyToHost )
572
572
for i := range y .CopyToHost {
573
573
FillCopyToHostDefaults (& y .CopyToHost [i ], instDir , y .User , y .Param )
574
574
}
@@ -605,7 +605,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
605
605
606
606
networks := make ([]Network , 0 , len (d .Networks )+ len (y .Networks )+ len (o .Networks ))
607
607
iface := make (map [string ]int )
608
- for _ , nw := range append ( append ( d .Networks , y .Networks ... ) , o .Networks ... ) {
608
+ for _ , nw := range slices . Concat ( d .Networks , y .Networks , o .Networks ) {
609
609
if i , ok := iface [nw .Interface ]; ok {
610
610
if nw .Socket != "" {
611
611
networks [i ].Socket = nw .Socket
@@ -649,7 +649,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
649
649
}
650
650
}
651
651
652
- y .MountTypesUnsupported = append ( append ( o .MountTypesUnsupported , y .MountTypesUnsupported ... ) , d .MountTypesUnsupported ... )
652
+ y .MountTypesUnsupported = slices . Concat ( o .MountTypesUnsupported , y .MountTypesUnsupported , d .MountTypesUnsupported )
653
653
mountTypesUnsupported := make (map [string ]struct {})
654
654
for _ , f := range y .MountTypesUnsupported {
655
655
mountTypesUnsupported [f ] = struct {}{}
@@ -698,7 +698,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
698
698
// Only works for exact matches; does not normalize case or resolve symlinks.
699
699
mounts := make ([]Mount , 0 , len (d .Mounts )+ len (y .Mounts )+ len (o .Mounts ))
700
700
location := make (map [string ]int )
701
- for _ , mount := range append ( append ( d .Mounts , y .Mounts ... ) , o .Mounts ... ) {
701
+ for _ , mount := range slices . Concat ( d .Mounts , y .Mounts , o .Mounts ) {
702
702
if out , err := executeHostTemplate (mount .Location , instDir , y .Param ); err == nil {
703
703
mount .Location = out .String ()
704
704
} else {
@@ -829,11 +829,8 @@ func FillDefault(y, d, o *LimaYAML, filePath string, warn bool) {
829
829
y .CACertificates .RemoveDefaults = ptr .Of (false )
830
830
}
831
831
832
- caFiles := unique (append (append (d .CACertificates .Files , y .CACertificates .Files ... ), o .CACertificates .Files ... ))
833
- y .CACertificates .Files = caFiles
834
-
835
- caCerts := unique (append (append (d .CACertificates .Certs , y .CACertificates .Certs ... ), o .CACertificates .Certs ... ))
836
- y .CACertificates .Certs = caCerts
832
+ y .CACertificates .Files = unique (slices .Concat (d .CACertificates .Files , y .CACertificates .Files , o .CACertificates .Files ))
833
+ y .CACertificates .Certs = unique (slices .Concat (d .CACertificates .Certs , y .CACertificates .Certs , o .CACertificates .Certs ))
837
834
838
835
if runtime .GOOS == "darwin" && IsNativeArch (AARCH64 ) {
839
836
if y .Rosetta .Enabled == nil {
0 commit comments