Commit Graph

64 Commits

Author SHA1 Message Date
Itxaka
2e9c85e63a
Add shim to choose next entry to boot from (#230) 2024-02-21 10:44:32 +01:00
Dimitris Karakasilis
d981656715
Install efi files in uki mode using naming convention
replace "artifact" with "active" in conf files and in filenames

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2024-02-13 16:12:20 +02:00
Itxaka
e80a435c53
Fix --source flag (#205) 2024-01-23 17:05:54 +01:00
Itxaka
53f49169b1
Fix uki mode detection (#198) 2024-01-10 10:38:31 +01:00
Itxaka
775756f4b6
Run install off the same command (#196) 2024-01-09 15:10:04 +01:00
Itxaka
e6b3e5092e
Exit on install validation if target disk has mounted partitions (#180) 2023-12-07 12:32:41 +01:00
Itxaka
6e1d761ded
Fix unwanted reboot from install config in upgrade/reset (#178) 2023-12-05 15:46:11 +01:00
Dimitris Karakasilis
b675730e8c
Rename variables to better reflect what they are (PR comment)
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 12:50:34 +03:00
Dimitris Karakasilis
48c445756e
Fix conf identation
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:59 +03:00
Dimitris Karakasilis
48a3f57048
Rename var
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:59 +03:00
Dimitris Karakasilis
15a926ad3b
Handle --source in install/manual-install/interactive-install the same way
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:59 +03:00
Dimitris Karakasilis
7d18e6504a
[WIP] Add --source to various commands
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:58 +03:00
Itxaka
677254e570
Pass the install event to the collector directly (#150) 2023-09-26 07:38:58 +00:00
Dimitris Karakasilis
bf40c48812
Move checkRoot to main
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-14 16:06:41 +03:00
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
1a72f56d67
Restore loading env from config file (#124) 2023-08-08 18:52:04 +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
9bff3742c1
Load elemental config/spec from cloud config (#82) 2023-07-20 15:53:48 +02:00
Itxaka
9c5731baa2
Rename go module kairos-agent (#81) 2023-07-10 14:39:48 +02:00
Itxaka
629a0b2eee
Set debug flag in the main app (#64) 2023-06-21 09:42:11 +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
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
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
002b8ba51f
Bring elemental-cli code into the agent (#13) 2023-05-05 18:43:21 +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
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
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
Mauro Morales
461516fec5 sparkles: Integrate schema validation (#853)
* Change ValidationError to return the actual error

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add validate command

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Warn validation errors when scanning configs

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add schema command to print config json schema

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add strict-validations flag

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint and remove focus

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Rename command schema to print-schema

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Fix issue by reading originalData

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Remove test from removed feature

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add comments to exported functions

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add test for validate.go

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Remove focus

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add more tests for root schema

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add more tests

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-02-14 16:15:13 +01:00
Ettore Di Giacinto
9c99670add robot: Don't run installation twice on installation tests (#811)
* 🤖 Don't run installation twice on installation tests

Signed-off-by: mudler <mudler@c3os.io>

* 🐛 Scan provided config in manual-install

Signed-off-by: mudler <mudler@c3os.io>

* 🤖 Git unshallow before running tests

Signed-off-by: mudler <mudler@c3os.io>

---------

Signed-off-by: mudler <mudler@c3os.io>
2023-02-03 18:41:35 +01:00
Jacob Payne
9ff30b4417 require userdata loaded before running install (#742)
Signed-off-by: Jacob Payne <jacob@spectrocloud.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2023-01-30 08:12:11 -07:00
Ettore Di Giacinto
746135eede sparkles: Add reset hook (#723)
Signed-off-by: mudler <mudler@c3os.io>

Signed-off-by: mudler <mudler@c3os.io>
2023-01-25 13:38:56 +01:00
Ettore Di Giacinto
ef93e321fa seedling: Drop references to node-config (#697)
Signed-off-by: mudler <mudler@c3os.io>

Signed-off-by: mudler <mudler@c3os.io>
2023-01-20 19:14:53 +01:00
Ettore Di Giacinto
667fd76d9d seedling: Webui enhancements (#620)
* 🌱 Make sure webui starts on alpine

Also drop to shell when there are no providers

Signed-off-by: mudler <mudler@c3os.io>

* 🌱 Suppress verbose logging on tty

Signed-off-by: mudler <mudler@c3os.io>

* 🌱 Print WebUI address

Signed-off-by: mudler <mudler@c3os.io>

* 🎨 Update banner

Signed-off-by: mudler <mudler@c3os.io>

* 🌱 Refactor, display also interfaces

Signed-off-by: mudler <mudler@c3os.io>

* 🌱 Address feedback from review

Signed-off-by: mudler <mudler@c3os.io>

Signed-off-by: mudler <mudler@c3os.io>
2023-01-08 21:49:23 +01:00
Ettore Di Giacinto
d59892c5c5 seedling: Webui installer (#587)
* 🌱 Add webui

Signed-off-by: mudler <mudler@c3os.io>

* 🌱 Re-read config files after loading bundles

Signed-off-by: mudler <mudler@c3os.io>

* [check-spelling] Update metadata

Update for https://github.com/kairos-io/kairos/actions/runs/3806058276/attempts/1
Accepted in https://github.com/kairos-io/kairos/pull/587#issuecomment-1367859480

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
Signed-off-by: mudler <mudler@c3os.io>

* 🎨 Beautify index page

Signed-off-by: mudler <mudler@c3os.io>

* Do not rerun if we were successful or we are already running

Signed-off-by: mudler <mudler@c3os.io>

* Add syntax highlight

Signed-off-by: mudler <mudler@c3os.io>

* Add error message

Signed-off-by: mudler <mudler@c3os.io>

* Add YAML validation and highlight

Signed-off-by: mudler <mudler@c3os.io>

* Fixup terminal output

Signed-off-by: mudler <mudler@c3os.io>

* Fix newlines

Signed-off-by: mudler <mudler@c3os.io>

* fixups

Signed-off-by: mudler <mudler@c3os.io>

* 🎨 Fixup lint issues

Signed-off-by: mudler <mudler@c3os.io>

* Mark dependencies

Signed-off-by: mudler <mudler@c3os.io>

* Let configure the listening address

Signed-off-by: mudler <mudler@c3os.io>

Signed-off-by: mudler <mudler@c3os.io>
Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
2023-01-05 14:15:05 +01:00
Eng Zer Jun
c868bbaf9e art: Move from io/ioutil to io and os packages (#470)
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>
2022-11-22 01:11:03 +08:00
Ettore Di Giacinto
7e11876248 art: Enhance error handling and display when a config is not loaded from the system (#267) 2022-10-24 16:57:02 +02:00
Santhosh
c7c68c222f set configScanDir as package scoped var (#264)
set config.Install.env variables in environment

adding env to config to use across all stages

switch to config.Scan to read config
2022-10-24 16:43:23 +05:30