Skip to content

Commit

Permalink
kola: Fix syncOptions
Browse files Browse the repository at this point in the history
Regression from d4b252b
We need to keep parsing the cosa build, just not actually use it
to sync the target options in order to match how the upgrade
test works.
  • Loading branch information
cgwalters committed Feb 27, 2020
1 parent 1c3f717 commit f15c823
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Expand Down Expand Up @@ -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 == "" {
Expand Down

0 comments on commit f15c823

Please sign in to comment.