Fix device auto flag on uki (#207)

This commit is contained in:
Itxaka
2024-01-24 10:44:19 +01:00
committed by GitHub
parent e80a435c53
commit e8dbe2f011

View File

@@ -581,6 +581,16 @@ func ReadUkiInstallSpecFromConfig(c *Config) (*v1.InstallUkiSpec, error) {
return &v1.InstallUkiSpec{}, err return &v1.InstallUkiSpec{}, err
} }
installSpec := sp.(*v1.InstallUkiSpec) installSpec := sp.(*v1.InstallUkiSpec)
// Workaround!
// If we set the "auto" for the device in the cloudconfig the value will be proper in the Config.Install.Device
// But on the cloud-config it will still appear as "auto" as we dont modify that
// Unfortunately as we load the full cloud-config and unmarshall it into our spec, we cannot infer from there
// What device was choosen, and re-choosing again could lead to different results
// So instead we do the check here and override the installSpec.Target with the Config.Install.Device
// as its the soonest we have access to both
if installSpec.Target == "auto" {
installSpec.Target = c.Install.Device
}
return installSpec, nil return installSpec, nil
} }