because we want the user's preferences to be applied last, thus
overriding whatever calculations we may do automatically.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
To limit responsibility or those functions and to keep the tests passing
(because they assumed no sanitization)
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
because they are unmarshalled with a custom unmarshaller so they don't
need to be exported
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
because it's actually configuration and it's better than using viper to
pass things around.
The `upgrade:` block seems to be ignored early in the process so even if
the user specifies an image there, the latest release will be looked up.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Track active/passive boot for upgrade workflow
Track what are we booting from during upgrade in order to not backup
active into passive if we are booting from passive.
If we are booting from active or recovery the workflow keeps as it was,
backup active into passive, and then move the transition image into
active.
Signed-off-by: Itxaka <itxaka@kairos.io>
* Fix config loading, install device and call sanitize
Syncs the cfg.install.device to the installspec.target
As on manual-install the device can actually come from a flag and its
not on the cloud-config, we need to initialize the InstallSpec with the
value of the cfg.Install.Device as by that time we already have the
final value of the install target.
Also calls sanitize on config and specs and warns if anything goes wrong
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Fix platform override and tests
The sanitize method for Config was never called so we never noticed that
its overriding the platform, even if we pass the WithPLatform option.
This patch fixes it by only overriding platform by default on sanitize
if the platform is empty, otherwise leave the platform on it values.
Also fixes the tests to use test facilities and a small fix to not try
to load the platform values form yaml
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Init the Install in the Config init
Just in case something tries to access it so they dont find a nil
Also adjusts some more tests
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>