@@ -182,7 +182,8 @@ func (c *cmdLaunch) launch(app string, instanceName string) error {
182182 }
183183 }
184184 }
185-
185+ launchSettings .Image = "images:" + application .InstallMethods [0 ].Resources .Image ()
186+ log .Info ("Selected image" , "image" , launchSettings .Image )
186187 if advanced {
187188
188189 // select install method
@@ -195,8 +196,8 @@ func (c *cmdLaunch) launch(app string, instanceName string) error {
195196 huh .NewSelect [int ]().
196197 Title ("Choose OS Option" ).
197198 Options (
198- huh .NewOption (application .InstallMethods [0 ].Resources .OS , 0 ),
199- huh .NewOption (application .InstallMethods [1 ].Resources .OS , 1 ),
199+ huh .NewOption (application .InstallMethods [0 ].Resources .GetOS () , 0 ),
200+ huh .NewOption (application .InstallMethods [1 ].Resources .GetOS () , 1 ),
200201 ).
201202 Value (& installMethod ),
202203 ),
@@ -486,10 +487,10 @@ func (c *cmdLaunch) launch(app string, instanceName string) error {
486487 extraConfigs ["environment.APPLICATION" ] = application .Name
487488
488489 // OS Type
489- extraConfigs ["environment.PCT_OSTYPE" ] = application .InstallMethods [launchSettings .InstallMethod ].Resources .OS
490+ extraConfigs ["environment.PCT_OSTYPE" ] = application .InstallMethods [launchSettings .InstallMethod ].Resources .GetOS ()
490491
491492 // OS Version
492- extraConfigs ["environment.PCT_OSVERSION" ] = application .InstallMethods [launchSettings .InstallMethod ].Resources .Version
493+ extraConfigs ["environment.PCT_OSVERSION" ] = application .InstallMethods [launchSettings .InstallMethod ].Resources .GetVersion ()
493494
494495 // tz
495496 extraConfigs ["environment.tz" ] = "Etc/UTC"
@@ -501,7 +502,7 @@ func (c *cmdLaunch) launch(app string, instanceName string) error {
501502 // Disable ipv6
502503 extraConfigs ["environment.DISABLEIPV6" ] = "yes" // todo: make this a form option
503504
504- if disableSecureBoot (application .InstallMethods [launchSettings .InstallMethod ].Resources .OS ) {
505+ if disableSecureBoot (application .InstallMethods [launchSettings .InstallMethod ].Resources .GetOS () ) {
505506 launchSettings .VMSecureBoot = false
506507 }
507508
@@ -516,7 +517,7 @@ func (c *cmdLaunch) launch(app string, instanceName string) error {
516517 }
517518
518519 var funcScript []byte
519- if application .InstallMethods [launchSettings .InstallMethod ].Resources .OS == "alpine" {
520+ if application .InstallMethods [launchSettings .InstallMethod ].Resources .GetOS () == "alpine" {
520521 funcScript , err = downloadRaw (repository , "misc" , "alpine-install.func" )
521522 if err != nil {
522523 fmt .Println ("download error:" , err )
@@ -533,6 +534,8 @@ func (c *cmdLaunch) launch(app string, instanceName string) error {
533534 //extraConfigs["environment.FUNCTIONS_FILE_PATH"] = string(funcScript)
534535
535536 extraConfigs ["environment.FUNCTIONS_FILE_PATH" ] = "/install.func"
537+ log .Info ("Preparing image" , "image" , launchSettings .Image )
538+
536539 createInstance := func () {
537540 // create the instance
538541 err := c .global .client .Launch (launchSettings .Image , launchSettings .Name , launchSettings .Profiles , extraConfigs , deviceOverrides , launchSettings .Network , launchSettings .VM , false )
0 commit comments