diff --git a/cmd/kola/options.go b/cmd/kola/options.go index 9af7087b6e..e1fa516816 100644 --- a/cmd/kola/options.go +++ b/cmd/kola/options.go @@ -143,6 +143,8 @@ func init() { // Sync up the command line options if there is dependency func syncOptionsImpl(useCosa bool) error { + var err error + kola.PacketOptions.Board = kola.QEMUOptions.Board kola.PacketOptions.GSOptions = &kola.GCEOptions @@ -169,10 +171,16 @@ func syncOptionsImpl(useCosa bool) error { return err } - if useCosa && kola.Options.CosaBuild != "" { - if err := syncCosaOptions(); err != nil { + if kola.Options.CosaBuild != "" { + kola.CosaBuild, err = cosa.ParseBuild(kola.Options.CosaBuild) + if err != nil { return err } + if useCosa { + if err := syncCosaOptions(); err != nil { + return err + } + } } units, _ := root.PersistentFlags().GetStringSlice("debug-systemd-units") @@ -204,15 +212,9 @@ func syncOptions() error { return syncOptionsImpl(true) } -// syncCosaOptions parses the cosa build and sets unset platform-specific +// syncCosaOptions sets unset platform-specific // options that can be derived from the cosa build metadata func syncCosaOptions() error { - var err error - kola.CosaBuild, err = cosa.ParseBuild(kola.Options.CosaBuild) - if err != nil { - return err - } - switch kolaPlatform { case "qemu-unpriv", "qemu": if kola.QEMUOptions.DiskImage == "" {