during interactive install all devices will appear but some of those are
not desirable as they cannot be used to install.
Skip those in the list
Signed-off-by: Itxaka <itxaka@kairos.io>
This will allow us to fix the broken test in master and also allow
people to downgrade to older releases.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
because empty source caused an error, because of Sanitize() failing.
handleEmptySource was never called.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This was failing but wasn't visible because it needs
`fail_on_bundles_errors: true` to be set in the Kairos config.
We need to find whether we need a new test or an existing one can be
adapted to catch this.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Its not our duty to trail anything, we already passing a logfile for it
to use, we log our stuff and dont pollute the standar output
Signed-off-by: Itxaka <itxaka@kairos.io>
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>
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>
* Allow validator to receive a config-schema
It will try to process a URL first, otherwise a file and if the file
is not present it will try to read the source as a cloud-config
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Validate cloud-config on WebUI
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update module github.com/erikgeiser/promptkit to v0.8.0
* 🎨 Adapt agent to new v0.8.0 promptkit version
Validation function for textinput now requires an error/nil instead of
a bool
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Itxaka <itxaka@spectrocloud.com>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
* ✨ custom user bind and ephemeral mounts
Users can now specify custom and ephemeral mounts in cloud-init under
the `install` section, e.g.:
```
users:
- name: kairos
...
install:
auto: true
device: "auto"
bind_mounts:
- /mnt/bind1
- /mnt/bind2
ephemeral_mounts:
- /mnt/ephemeral
- /mnt/ephemeral2
...
```
Ephemeral mounts are mounted as RW - but changes are discarded when the
machine is restart.
Bind mounts will persist changes after restarted.
This is a fix for #210
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Add the custom user mount to /cos/run/cos-layout.env
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Add docs for custom user mounts in configuration example
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Reuse test_install function
DRY the code, change how we call the function install_test
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Enable custom mount tests and install tests
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Enable tests in CI
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Remove duplicate if check
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Remove uneeded fmt.Println ...
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Use separate label for custom mounts
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 Earthfile - DRY ginkgo
We repeat this a more than twice so just extract to own
target...
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Correct return type for ContainElements
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Remove CLOUD_INIT from custom mounts test
This is not needed here.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Fix qemu-test-* earthly targets
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 Fix CPU passing to VM
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 remove apt cache after install qemu
Helps deal with space running out in the CI.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 📖 Document custom mounts
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
---------
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
* 🌱 Add version information directly from git
Partial fix for kairos-io/kairos#643.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Update cmd/profile-build/main.go
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
* 🌱 Vendor webui dependencies
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Remove GA caching
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* The deps need to be there before the compilation of the agent
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Remove unnecesary tag
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Do not build webui-deps
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
refactor: move from io/ioutil to io and os packages
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.
[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>