1
0
mirror of https://github.com/kairos-io/kairos-agent.git synced 2025-05-11 01:44:53 +00:00
Commit Graph

28 Commits

Author SHA1 Message Date
Itxaka
9c5731baa2
Rename go module kairos-agent () 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
b126f7ab00
Drop --local flag for image sources () 2023-06-21 09:39:59 +02:00
Itxaka
ed372395d2
Drop collector package and use sdk for it () 2023-06-14 14:44:22 +02:00
Itxaka
14e562bb16
🐛 Read upgrade/install values from config ()
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
Itxaka
1e1638f258
Modify upgrade image flag to accept more formats ()
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-06-05 13:19:39 +00:00
Itxaka
ddfa30a4c6
Drop luet, image extractor, drop build code and multiarch images ()
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-05-16 16:06:49 +02:00
Itxaka
c449a1ae43
🐛 Using the wrong method to generate the upgrade spec () 2023-05-08 15:00:56 +02:00
Itxaka
002b8ba51f
Bring elemental-cli code into the agent () 2023-05-05 18:43:21 +02:00
Itxaka
b996feeb27 sparkles: Allow showing pre-releases on upgrade options ()
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 ()
* 🐛 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
Dimitris Karakasilis
e7807dd66c Change module path according to Go docs ()
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 ()
* 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
148fc21c0e seedling: Add auth flags to upgrade () 2023-03-24 14:00:33 +01:00
Itxaka
75c52f520f Bump to newer sdk () 2023-03-18 10:27:18 +01:00
Itxaka
b5cfab06a7 sparkles: Use kairos-sdk module () 2023-03-15 15:45:00 +01:00
Mauro Morales
461516fec5 sparkles: Integrate schema validation ()
* 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
080a34bd9a Upgrade to latest release if one is not specified and ask user to confirm ()
* Upgrade to latest release if one is not specified and ask user to confirm

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

* Re-use existing promptBool function

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

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-07 20:28:33 +02:00
Santhosh
c7c68c222f set configScanDir as package scoped var ()
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
Ettore Di Giacinto
e25526cfc9 art: Rebranding ()
See: https://github.com/c3os-io/c3os/issues/88
2022-09-17 18:43:51 +02:00
Ettore Di Giacinto
4ebe503e1b robot: Add bundles test suite, fixup linting issues 2022-08-18 15:19:15 +00:00
Ettore Di Giacinto
6fc2693229 art: Always stream out an event 2022-08-18 13:32:33 +00:00
Ettore Di Giacinto
fe03afa167 art: Expose to sdk upgrade/list events 2022-08-18 13:12:05 +00:00
Ettore Di Giacinto
7fb4c70630 art: Add --debug to upgrade 2022-08-17 08:31:39 +00:00
Ettore Di Giacinto
db2bcc0451 art: Write only version to VERSION in os-release
Add FLAVOR and VARIANT to handle those separately, this should also fix upgrades.

Fixes https://github.com/c3os-io/c3os/issues/80
2022-08-17 08:02:18 +00:00
mudler
3c6484de14 art: Drop provider from c3os code
Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-10 18:56:07 +02:00
Ettore Di Giacinto
602d086ce4 art: Refactor agent code
Move out cmd pieces and split into its own package. Also make sure we reload
plugins before bootstrapping nodes.

Also commons out the agent configuration in a specific YAML file.
2022-07-18 22:02:49 +00:00