Commit Graph

64 Commits

Author SHA1 Message Date
Itxaka
db703db5e5
Try to fix hooks (#718)
* fix hooks


---------

Signed-off-by: Itxaka <itxaka@kairos.io>
2025-03-24 16:05:39 +01:00
Itxaka
e2c3a0e638
Read actual system configs during k8s upgrade (#579) 2024-10-16 12:36:19 +02:00
Itxaka
97d25b8993
Check for user+admin validity before actions (#575) 2024-10-15 10:47:09 +02:00
Itxaka
e8bb8cf4ff
Move to use kairos-release (#567) 2024-10-07 09:44:05 +00:00
Dimitris Karakasilis
257d0a1c38
Unify --recover and --boot-entry upgrade options in code
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2024-08-26 16:33:44 +03:00
Dimitris Karakasilis
c589ae1ce3
[WIP] Properly handle single entries in bootentry command
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2024-08-26 16:32:43 +03:00
Dimitris Karakasilis
1f2d8d89fc
Move the Image() filtering to kairos-sdk
https://github.com/kairos-io/kairos-sdk/pull/85/files

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

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2024-04-12 09:40:26 +03:00
Dimitris Karakasilis
db0a65cf6e
Return only image (skipping sbom, img, etc)
Fixes: https://github.com/kairos-io/kairos/issues/2329

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2024-04-02 17:15:20 +03:00
Dimitris Karakasilis
88454bdda4
Implement uki "kairos-agent upgrade --recovery"
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2024-02-20 13:30:52 +02:00
Itxaka
0119b9cfb2
Fix object dumping (#222) 2024-02-05 11:30:24 +01:00
Itxaka
33c8e8f29c
Add reset for uki (#221) 2024-02-02 13:20:06 +01:00
Itxaka
9941c786a3
Fix uki upgade path (#219) 2024-01-31 19:38:16 +01:00
Dimitris Karakasilis
9a8c404cfa
Add "--all" flag to list-releases to print older releases too
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>
2024-01-11 10:43:45 +02:00
Itxaka
174d69c3ea
Merge uki upgrade into the normal upgrade command (#197) 2024-01-09 16:42:49 +01:00
Itxaka
3254b8a36e
Uki upgrade (#182) 2023-12-18 11:38:26 +01:00
Dimitris Karakasilis
2412d69e32
Re-enable call-out to provider for releases
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-12-08 10:50:01 +02:00
Dimitris Karakasilis
00ce75b285
Deprecate positional argument and cleanup unused code
because empty source caused an error, because of Sanitize() failing.
handleEmptySource was never called.

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-12-07 18:20:16 +02:00
Dimitris Karakasilis
823343546a
Fix "upgrade list-releases" command by consuming kairos-sdk versioneer
Also add TODOs for remaining work

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-12-07 15:00:45 +02:00
Dimitris Karakasilis
48fc6180cf
Return image from bus when one exists
it was accidentally returning "nil"

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-10-02 12:47:04 +03: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
b68b07f278
Remove unecessary type definition
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:46:00 +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
c58efaa623
Add test and remove debugging logs
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:59 +03:00
Dimitris Karakasilis
968812dfbb
Exctract the generation of the upgrade spec to a function
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:59 +03:00
Dimitris Karakasilis
afe08c5ca5
Generate additional config only if needed
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:59 +03:00
Dimitris Karakasilis
8dd7577148
WIP
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-09-29 11:45:59 +03:00
Itxaka Serrano Garcia
60815d060e
Refactor
Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
2023-09-29 11:45:59 +03:00
Dimitris Karakasilis
3482e88aa3
[WIP] Try to pass command line options for upgrade as kairos config
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>
2023-09-29 11:45:58 +03: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
dffef50ca0
Several improvements for size calculation (#129) 2023-08-17 13:53:45 +02:00
Itxaka
3e9befa230
Add recovery upgrade flag to upgrade command + msg (#123) 2023-08-07 16:11:13 +02:00
Itxaka
f7bdba2dda
Merge elemental config into agent config (#102) 2023-07-25 15:21:34 +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
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
b126f7ab00
Drop --local flag for image sources (#63) 2023-06-21 09:39:59 +02: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
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
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
c449a1ae43
🐛 Using the wrong method to generate the upgrade spec (#15) 2023-05-08 15:00:56 +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
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