Commit Graph

103 Commits

Author SHA1 Message Date
Dimitris Karakasilis
fddbf3f657
Check root permissions in commands that need it
Otherwise the error shown is not helpful (it fails too late with
confusing errors).

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-14 16:06:38 +03:00
Itxaka
7c060a764e
Fix manual-install reboot/poweroff flags (#131) 2023-08-18 12:54:42 +02:00
Itxaka
dffef50ca0
Several improvements for size calculation (#129) 2023-08-17 13:53:45 +02:00
Itxaka
1a72f56d67
Restore loading env from config file (#124) 2023-08-08 18:52:04 +02:00
Itxaka
3e9befa230
Add recovery upgrade flag to upgrade command + msg (#123) 2023-08-07 16:11:13 +02:00
Itxaka
f5c01f73a4
Make unattended reset work (#110)
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>
2023-08-04 20:39:22 +02:00
Itxaka
00eae4c029
Make interactive installer use the collector as well (#113) 2023-08-03 19:49:09 +02:00
Itxaka
822222a645
Drop override of message options after install (#112) 2023-08-03 19:46:13 +02:00
Itxaka
d44bc2e898
Rework install workflow for event stuff (#106) 2023-08-01 12:33:40 +02:00
Itxaka
f7bdba2dda
Merge elemental config into agent config (#102) 2023-07-25 15:21:34 +02:00
Itxaka
5b945303c9
Drop runconfig in favour of config (#101) 2023-07-25 11:08:27 +02:00
Itxaka
bca3277b7d
Rework install a bit more (#100)
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-07-25 09:12:39 +02:00
Itxaka
956f86f99c
Rework reboot/shutdown to use the hooks (#96) 2023-07-24 12:28:59 +02:00
Itxaka
922d35b4f1
Merge data from events into reset (#91) 2023-07-21 10:37:53 +02:00
Itxaka
9bff3742c1
Load elemental config/spec from cloud config (#82) 2023-07-20 15:53:48 +02:00
Itxaka
1ab0898c2c
Fix releases coming from the bus (#90) 2023-07-20 12:02:43 +02:00
Itxaka
9c5731baa2
Rename go module kairos-agent (#81) 2023-07-10 14:39:48 +02:00
Mauro Morales
62eee9ffbf
Refactor
Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
2023-06-30 11:37:50 +03:00
Mauro Morales
609c274636 Remove validation of os-release attribute when source has been given for upgrades
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-06-29 15:40:40 +02:00
Itxaka
629a0b2eee
Set debug flag in the main app (#64) 2023-06-21 09:42:11 +02:00
Itxaka
b126f7ab00
Drop --local flag for image sources (#63) 2023-06-21 09:39:59 +02:00
Itxaka
75586ad601
Install improvements (#62) 2023-06-20 09:58:01 +03:00
Itxaka
ed372395d2
Drop collector package and use sdk for it (#59) 2023-06-14 14:44:22 +02:00
Itxaka
14e562bb16
🐛 Read upgrade/install values from config (#55)
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>
2023-06-08 09:50:19 +00:00
Dimitris Karakasilis
a113147f8a
1225 config collector elemental (#32)
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
Co-authored-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
2023-06-07 11:28:37 +02:00
Itxaka
1e1638f258
Modify upgrade image flag to accept more formats (#39)
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-06-05 13:19:39 +00:00
Itxaka
b55e3e0800
🐛 Fix the cleanup of ssh users (#38) 2023-06-05 12:40:13 +02:00
Dimitris Karakasilis
0ae57a99aa
Don't let "elemental" reboot
because the Lifecycle hook will do that

Fixes https://github.com/kairos-io/kairos/issues/1460

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-05-31 12:42:44 +03:00
Mauro Morales
e23346ae44
Extract schema validation to SDK
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-05-26 12:38:54 +02:00
Itxaka
8e456ec8b6
Run the user in initramfs if we dont need network (#33) 2023-05-26 09:48:11 +02:00
Itxaka
3c484d9885
Add debug flag in root cmd (#31) 2023-05-24 10:39:17 +02:00
Itxaka
1afe3c2dbd
Run stages directly from code instead of shelling out (#23)
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-05-16 18:06:49 +02:00
Itxaka
ddfa30a4c6
Drop luet, image extractor, drop build code and multiarch images (#20)
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-05-16 16:06:49 +02:00
Itxaka
cda46877ba
Mount OEM during kcrypt hook (#18) 2023-05-09 21:57:16 +02:00
Itxaka
c449a1ae43
🐛 Using the wrong method to generate the upgrade spec (#15) 2023-05-08 15:00:56 +02:00
Itxaka
10df8d98cb
Drop kcrypt mappings (#14) 2023-05-08 09:43:47 +02:00
Itxaka
002b8ba51f
Bring elemental-cli code into the agent (#13) 2023-05-05 18:43:21 +02:00
Itxaka
b996feeb27 sparkles: Allow showing pre-releases on upgrade options (#1333)
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>
2023-04-21 12:32:28 +02:00
Itxaka
4035ee0489 bug: Fix version list (#1323)
* 🐛 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>
2023-04-20 09:57:58 +02:00
Ettore Di Giacinto
e5e595be4c bug: Ensure data source is ready during reset (#1310)
Signed-off-by: mudler <mudler@c3os.io>
2023-04-17 17:27:37 +02:00
Mauro Morales
961804be0a arrow_up: Bump go in Earthly and workflows to ^1.20 (#1213)
* 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>
2023-03-30 16:42:25 +02:00
Dimitris Karakasilis
e7807dd66c Change module path according to Go docs (#1220)
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>
2023-03-30 14:18:53 +03:00
Mauro Morales
1073b07f6a sparkles: Custom partitioning refactor config (#1180)
* 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>
2023-03-29 16:25:38 +02:00
Itxaka
107a4ab02f bug: Fix validator on long strings (#1194)
* 🐛 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>
2023-03-28 18:20:56 +02:00
Itxaka
148fc21c0e seedling: Add auth flags to upgrade (#1179) 2023-03-24 14:00:33 +01:00
Itxaka
75c52f520f Bump to newer sdk (#1166) 2023-03-18 10:27:18 +01:00
Itxaka
b5cfab06a7 sparkles: Use kairos-sdk module (#1140) 2023-03-15 15:45:00 +01:00
Oz Tiram
ce4631fd07 bug: Fix configuration not being merge (#1117)
Fix #687.

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
2023-03-14 15:44:49 +01:00
Ettore Di Giacinto
6bc750130c robot: Delete duplicate test suite registration (#1091)
Signed-off-by: mudler <mudler@c3os.io>
2023-03-10 11:10:03 +01:00
Jacob Payne
e57ef905a4 bug: Fix manual install not supporting configuration url (#963)
* 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>
2023-03-08 10:13:36 -07:00