@@ -111,7 +111,7 @@ func setupEnv(y *limayaml.LimaYAML, args TemplateArgs) (map[string]string, error
111
111
return env , nil
112
112
}
113
113
114
- func templateArgs (instDir , name string , y * limayaml.LimaYAML , udpDNSLocalPort , tcpDNSLocalPort , vsockPort int , virtioPort string ) (* TemplateArgs , error ) {
114
+ func templateArgs (bootScripts bool , instDir , name string , y * limayaml.LimaYAML , udpDNSLocalPort , tcpDNSLocalPort , vsockPort int , virtioPort string ) (* TemplateArgs , error ) {
115
115
if err := limayaml .Validate (y , false ); err != nil {
116
116
return nil , err
117
117
}
@@ -124,6 +124,7 @@ func templateArgs(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort, t
124
124
return nil , err
125
125
}
126
126
args := TemplateArgs {
127
+ BootScripts : bootScripts ,
127
128
Name : name ,
128
129
User : u .Username ,
129
130
UID : uid ,
@@ -328,10 +329,14 @@ func templateArgs(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort, t
328
329
}
329
330
330
331
func GenerateCloudConfig (instDir , name string , y * limayaml.LimaYAML ) error {
331
- args , err := templateArgs (instDir , name , y , 0 , 0 , 0 , "" )
332
+ args , err := templateArgs (false , instDir , name , y , 0 , 0 , 0 , "" )
332
333
if err != nil {
333
334
return err
334
335
}
336
+ // mounts are not included here
337
+ args .Mounts = nil
338
+ // resolv_conf is not included here
339
+ args .DNSAddresses = nil
335
340
336
341
if err := ValidateTemplateArgs (args ); err != nil {
337
342
return err
@@ -342,11 +347,12 @@ func GenerateCloudConfig(instDir, name string, y *limayaml.LimaYAML) error {
342
347
return err
343
348
}
344
349
350
+ os .RemoveAll (filepath .Join (instDir , filenames .CloudConfig )) // delete existing
345
351
return os .WriteFile (filepath .Join (instDir , filenames .CloudConfig ), config , 0o444 )
346
352
}
347
353
348
354
func GenerateISO9660 (instDir , name string , y * limayaml.LimaYAML , udpDNSLocalPort , tcpDNSLocalPort int , nerdctlArchive string , vsockPort int , virtioPort string ) error {
349
- args , err := templateArgs (instDir , name , y , udpDNSLocalPort , tcpDNSLocalPort , vsockPort , virtioPort )
355
+ args , err := templateArgs (true , instDir , name , y , udpDNSLocalPort , tcpDNSLocalPort , vsockPort , virtioPort )
350
356
if err != nil {
351
357
return err
352
358
}
0 commit comments