Skip to content

Commit

Permalink
Fix device auto flag on uki (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka authored Jan 24, 2024
1 parent e80a435 commit e8dbe2f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/config/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,16 @@ func ReadUkiInstallSpecFromConfig(c *Config) (*v1.InstallUkiSpec, error) {
return &v1.InstallUkiSpec{}, err
}
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
}

Expand Down

0 comments on commit e8dbe2f

Please sign in to comment.