Our current example for cloud images on the docs on how to use the reset
with a cloud-config and a stage does not actually work as the tty
adquisition and such seems to be failing due tto not being properly run
in a tty.
This pathc introduces 2 new flags to the reset command.
reboot: Enable reboot after reset, overriding any config in the system.
This is only a enable switch, so if the flag is disabled but the config
says reset it will NOT override it.
unattended: Disables printing stuff into the screen, locking the
terminal and falling back to a new tty on run. Also enables fast mode
automatically.
Signed-off-by: Itxaka <itxaka@kairos.io>
We were ignoring the values in the /etc/elemental/config.yaml file that
we loaded into viper by not reading those values and their keys into the
final spec.
This meant that for example the defautl entry name was being lost as we
generated a new install spec from scratch and ignored those values that
we read on the config
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
By default get 30 releases and skip any pre-releases found.
Allow toggling showing pre-releases both for upgrade and for listing
them
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* 🐛 Fix version list
First version in the list is the latest one.
Alos moves the check for same version above the current place, so it can
check before asking if you want to update to the same version
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* 🌱 Rework versioning for upgrade
Use the semver lib to parse the versions into a proper collection where
it can be parsed and versions compared and sorted properly
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* 🤖 lint
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Bump go in Earthly and workflows to ^1.20
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update go.mod version
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Lint
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Remove pin of go version to get the latest
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Remove minor version
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
https://go.dev/doc/modules/major-version
This way we can bump the kairos dependency on the provider-kairos repo
which otherwise produced the error:
```
~/workspace/kairos/provider-kairos (main)*$ go get -u github.com/kairos-io/kairos@v2.0.0-alpha3
go: github.com/kairos-io/kairos@v2.0.0-alpha3: invalid version: module contains a go.mod file, so module path must match major version ("github.com/kairos-io/kairos/v2")
```
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Introduce config/collector package
to split the collection of config sources out of the config package.
Each consumer of the new package will take care of unmarshalling the
yaml to a specific Config struct, do validations etc.
* Add tests and remove garbage
* Follow all config_url chains and test it
* Add missing options file and refactor cmdline code
* Consolidate the way we merge configs no matter where they come from
* Allow and use only files with valid headers
Config is specific to Kairos while Collector is generic. This
will allow us to do validations which are just related to Kairos at the
config level, while including every type of key and querying of the full
yaml at the Collector level splitting the responsibilities of each
package.
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* 🐛 Fix validator on long strings
Validator was mistakenly identifying a long yaml as a file and trying to
open it, which failed with an error of filename too long.
This was not catched in order to identify that the source is not a file
but a yaml, so it was directly returning the error.
This patch adds that error to the list in order ot identify the source
to validate as yaml. Also adds a couple of tests for this functionality.
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* 🐛 Merge initramfs generation between distros
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* fixed manual install not supporting configuration url
Signed-off-by: Jacob Payne <jacob@spectrocloud.com>
* break out url logic and add testing.
Signed-off-by: Jacob Payne <jacob@spectrocloud.com>
---------
Signed-off-by: Jacob Payne <jacob@spectrocloud.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>