From e8dbe2f011b5740d09ca6b6e42cc900751ca5fe1 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 24 Jan 2024 10:44:19 +0100 Subject: [PATCH] Fix device auto flag on uki (#207) --- pkg/config/spec.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/config/spec.go b/pkg/config/spec.go index 5540418..91d33a1 100644 --- a/pkg/config/spec.go +++ b/pkg/config/spec.go @@ -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 }