Commit Graph

1212 Commits

Author SHA1 Message Date
mudler
cc1f0862d0 gear: Display available disks before prompt in interactive-install 2022-05-14 21:56:48 +02:00
mudler
e9f180a906 gear: Add interactive installer 2022-05-12 00:47:22 +02:00
Ettore Di Giacinto
b16bfda671 Fixups (#26)
* 🤖 Fixup master ARM builds

* ⚙️ Override openrc envs by writing to /etc/rancher

* 🤖 Enable alpine tests

* ⬆️ Bump edgevpn

* ⚙️ Fixup ntpd start on alpine #20

* 🤖 Reword tests

* 🤖 Run alpine tests in parallel

* ⚙️ Upgrades are broken on alpine, skip tests

* 📒 Add datasource ISO docs

* ⚙️ Properly set k3s env file in openRC

* ⚙️ Add udev-trigger

See: https://github.com/rancher-sandbox/elemental/issues/198

* 🤖 Run upgrade tests on alpine

* ⚙️ Add svcs to Alpine ARM images

* 🤖 Test fixups

* ⚙️ Re-enable boot-assessment on ARM

* ⚙️ Add default bashrc local

* ⚙️ Fixup tmp layout on alpine
2022-05-11 22:45:40 +02:00
mudler
1d1314627b arrow_up: Update go mod 2022-05-09 00:02:33 +02:00
mudler
5d25e19010 arrow_up: Bump go mod 2022-05-07 23:26:56 +02:00
mudler
4f6993cd1b arrow_up: Bump go mod 2022-05-07 22:15:24 +02:00
mudler
2ecbfa4e3e gear: Allow to set loglevel when registering 2022-05-07 22:13:26 +02:00
mudler
071b3ebf56 gear: Update go-version 2022-05-07 00:24:37 +02:00
mudler
aeeb20a058 gear: Setup DNS with cloud init 2022-05-06 21:53:27 +02:00
Ettore Di Giacinto
250788fb3c arrow_up: Bump edgevpn 2022-05-06 17:58:18 +02:00
mudler
7a6a3f2538 robot: Keep only one minor version when tagging 2022-04-26 22:58:40 +02:00
mudler
ae28cb6e53 gear: Fixup bind ip 2022-04-24 21:45:58 +02:00
Ettore Di Giacinto
4f452d9ffc gear: Spawn custom ssh server during recovery 2022-04-24 17:36:00 +02:00
Ettore Di Giacinto
6852b9439c arrow_up: Bump internal version and update vpn 2022-03-18 19:13:23 +01:00
Ettore Di Giacinto
d5ad69daba arrow_up: Bump cOS and edgevpn 2022-03-17 20:57:54 +01:00
Ettore Di Giacinto
0e45520bd2 gear: Add bridge command to cli 2022-02-23 19:24:34 +01:00
Ettore Di Giacinto
eae33b9ea3 arrow_up: Update go mod 2022-02-22 21:16:11 +01:00
Ettore Di Giacinto
4a49786bd2 robot: Simplify tests 2022-02-19 00:01:42 +01:00
Ettore Di Giacinto
55dbab07eb gear: Add wrappers to rotate token and upgrade 2022-02-18 18:30:20 +01:00
Ettore Di Giacinto
9df7234448 gear: Move to c3os-io
Update URL and default images
2022-02-17 20:46:36 +01:00
Ettore Di Giacinto
8f1a3c04b7 arrow_up: Updates, small fixups 2022-02-09 22:51:34 +01:00
Ettore Di Giacinto
446a20ec3e gear: Add automatic setup via mesh configuration
Also enhance output and instructions on first boot
2022-02-07 19:11:26 +01:00
Ettore Di Giacinto
8b04fc2564 Update deps 2022-02-04 23:20:25 +01:00
Ettore Di Giacinto
c06c52869a Add automated install via pairing 2022-02-02 00:02:30 +01:00
Itxaka
7cadb1a20b 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
d9c3ba5915 robot: Fix release tests (#1332)
Looks like we only get a small subset of the releases so we cant check
for a specific number in the list that we get

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-04-21 11:04:03 +02:00
Itxaka
1f316097be 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
Itxaka
ef0c14006b bug: Fix agent not able to get subkeys (#1299)
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-04-15 13:45:13 +02:00
Mauro Morales
b8b3e83ef1 bug: Do not merge all cmdline arguments to generic config (#1256)
* Do not merge all cmdline arguments to generic config

Instead allow only specific Kairos config ones, this should not be known by the collector but doing it this way as a temporary hack to release 2.0 and then we can do properly

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

* Remove fmt.Println

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

* Lint

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

* imports

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

* Filter using a cloud config structure

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

* Pass a filter function

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

* Exclude collector config from config.Config yaml

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

* Fix issue with test now that a yaml tag gets ignored

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

* cleanup FilterKeys func

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

* Add comment

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-04-06 15:18:15 +02:00
Dimitris Karakasilis
d7fc1ee026 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
b513c69a0c 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
b7ea097d35 Bump to newer sdk (#1166) 2023-03-18 10:27:18 +01:00
Itxaka
df8b9824fc sparkles: Use kairos-sdk module (#1140) 2023-03-15 15:45:00 +01:00
Itxaka
4a04208eee robot: Fix users schema test (#1101)
Groups changed and unit tests were not passing

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-10 15:25:53 +01:00
Itxaka
80ab9ca7ef bug: Schema for groups is not working (#1077)
Looks like the schema for the user thinks groups is a string, while checking the code it seems to be more a list of strings and that matches with the yip library and how it parses the groups.

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-10 14:21:26 +01:00
Ettore Di Giacinto
b29c2d8591 bug: Don't fail when config_url is not accessible (#957)
Don't fail when config_url is not accessible

but rather print a Warning.

Fixes #885

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-02-24 10:09:22 +01:00
Mauro Morales
5c57dcebdf 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
Dimitris Karakasilis
a09db09db7 seedling: Don't swallow yaml config errors (#846)
* Don't swallow yaml config errors

because installation continues and there is no indication that something
went wrong

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Apply suggestions from code review

Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: Dimitris Karakasilis <jimmykarily@gmail.com>

---------

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <jimmykarily@gmail.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2023-02-08 22:13:13 +02:00
Mauro Morales
84c68ff0b8 seedling: Kairos config validator library (#798)
* Validate yaml

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

* lint feedback

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

* Validate User name with JsonSchema

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

* WIP users validation

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

* Add multiple examples for ssh keys

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

* Add example of complex validation with AnyOf

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

* Better business rule example with P2P

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

* Test with message for empty network_token

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

* Split into a file for each sub section

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

* Add install schema validations

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

* Add to main schema

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

* Add more tests for p2p

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

* Add install schema

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

* Validate fields between new and old schema

It also adds the missing ones

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

* Lint

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

* Remove temp debugging functions

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

* Add new fields in old schema

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

* Add documentation for all exported

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

* Move schemas into a directory of their own

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

* Add missing dot at end of comment

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

* Rebase master and add local_file to bundles

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-02-08 11:02:13 +01:00
Santhosh
0a62e316e0 set local_file bundleconfig to true if target prefix is file:// (#823)
set local file bundleconfig to true if target prefix is file://

Signed-off-by: Santhosh <santhosh@spectrocloud.com>
2023-02-07 18:13:03 +05:30
Oz Tiram
b37a34beae sparkles: custom user bind and ephemeral mounts (#692)
*  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>
2023-02-03 11:04:02 +01:00
Ettore Di Giacinto
da44dbb47f seedling: Drop unrequired copy (#683)
Signed-off-by: mudler <mudler@c3os.io>

Signed-off-by: mudler <mudler@c3os.io>
2023-01-20 10:29:35 +01:00
Mauro Morales
1a9104c121 bug: Remove duplicated list of upgradable releases (#688)
* Remove duplicated list of upgradable releases

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

* Make list output consistent

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

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-01-19 22:16:13 +01:00
Dimitris Karakasilis
704cff80d2 Merge pull request #665 from kairos-io/399_deeply_merge_configs
Deeply merge yamls in original data
2023-01-18 11:16:05 +02:00
Ettore Di Giacinto
cffbc3f35f 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
e15014addc 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
Ettore Di Giacinto
741ac7a385 seedling: Keep current dir when installing runnable bundles (#582)
Signed-off-by: mudler <mudler@c3os.io>

Signed-off-by: mudler <mudler@c3os.io>
2022-12-23 16:51:54 +01:00
Ettore Di Giacinto
a909c44620 seedling: Return configuration data from the agent (#567)
* 🌱 Return configuration data from the agent

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

* 🤖 Cover query by tests

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2022-12-19 17:01:57 +01:00
Ettore Di Giacinto
2bf4793c41 bug: Process only cloud configs (#550)
Regression introduced in https://github.com/kairos-io/kairos/pull/502.
Now also files like .lst inside the initramfs are globbed inside /oem/90_custom.yaml

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2022-12-10 18:51:25 +01:00
Ettore Di Giacinto
3d92e4ae43 seedling: Glob all configs found (#502)
* 🌱 Glob all configs found

This allows to read all the configs found during scanning - this is especially useful in first boot as it allows
to have separate config file logic split into several files

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

* 🌱 Simplify config merge logic

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* WIP

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* 🌱 Make the function work

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: mudler <mudler@kairos.io>

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: mudler <mudler@kairos.io>
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-28 15:37:45 +01:00