mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-16 22:50:47 +00:00
Fix device auto flag on uki (#207)
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user