Skip to content

Commit

Permalink
Merge pull request coreos#1195 from cgwalters/fix-syncoptions
Browse files Browse the repository at this point in the history
kola: Fix syncOptions
  • Loading branch information
jlebon authored Feb 27, 2020
2 parents 1c3f717 + f15c823 commit 0f510e4
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 0f510e4

Please sign in to comment.