kola: Fix Ignition version from disk image (no cosa build)
This got subtly broken in a refactoring; we need to infer
the ignition version from the disk image name if no cosa build
is provided.
This is necessary for handling `cosa run -d /path/to/rhcos-4.2.0.qcow2`.
@@ -186,6 +186,10 @@ func syncOptionsImpl(useCosa bool) error {
}
}
+ if kola.Options.IgnitionVersion == "" && kola.QEMUOptions.DiskImage != "" {
+ kola.Options.IgnitionVersion = sdk.TargetIgnitionVersionFromName(kola.QEMUOptions.DiskImage)
+ }
+
units, _ := root.PersistentFlags().GetStringSlice("debug-systemd-units")
for _, unit := range units {
kola.Options.SystemdDropins = append(kola.Options.SystemdDropins, platform.SystemdDropin{
@@ -234,8 +238,6 @@ func syncCosaOptions() error {
if kola.Options.IgnitionVersion == "" {
if kola.CosaBuild != nil {
kola.Options.IgnitionVersion = sdk.TargetIgnitionVersion(kola.CosaBuild)
- } else if kola.QEMUOptions.DiskImage != "" {
- kola.Options.IgnitionVersion = sdk.TargetIgnitionVersionFromName(kola.QEMUOptions.DiskImage)
}
}
