Commit Graph

74 Commits

Author SHA1 Message Date
Itxaka
709ed8bd8a Fix FilterKeys issue
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-06-14 12:26:34 +02:00
Itxaka
b174df7f03 lint
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-06-14 12:26:26 +02:00
Itxaka
3ee0428611 Bring collector into the sdk
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-06-14 12:26:26 +02:00
Mauro Morales
cd5173edb8
Add issue template (#30)
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-06-14 08:59:09 +02:00
Itxaka
dd4fbb8014
Identify lvm partitions for state (#28) 2023-06-07 14:48:27 +02:00
Itxaka
425e07d8c7
Add noFormat to install schema (#27) 2023-06-07 11:13:13 +02:00
Mauro Morales
c90740d747
Move schema validation to sdk to be used by different repos (#21)
* Move schema validation to sdk to be used by different repos

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

* remove unused

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

* fix recommendations

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-05-26 12:32:01 +02:00
Itxaka
3524a69e57
Remove leftover print (#18) 2023-05-23 15:13:41 +02:00
Itxaka
f5982c9d5a
Try to create rootpath before extracting image if it doesnt exist (#17) 2023-05-18 12:17:40 +02:00
Itxaka
40db3d970e
Allow setting the platform of the image to download (#15) 2023-05-17 08:04:20 +00:00
renovate[bot]
60c5f9c587
fix(deps): update module github.com/pterm/pterm to v0.12.61 (#11)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-05-17 09:45:37 +02:00
renovate[bot]
4499cee97d
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.9.5 (#9)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-17 09:45:17 +02:00
renovate[bot]
2d2962a725
fix(deps): update module github.com/google/go-containerregistry to v0.15.2 (#16)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-17 09:45:04 +02:00
renovate[bot]
0aa1d3243e
chore(deps): update actions/setup-go action to v4 (#6)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-17 00:13:50 +02:00
renovate[bot]
d9a4f04744
fix(deps): update module github.com/mudler/yip to v1 (#2)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-17 00:13:04 +02:00
Itxaka
ee38ccde54
Improve bundles for container and run to not use luet (#13)
This allows us to pull natively and support multiarch and auth out of
the box

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-05-16 17:59:04 +02:00
Mauro Morales
0c9d2bd9e6
🌱 Read os-release attributes using kairos prefix (#12)
* Read os-release attributes using kairos prefix

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

* Refactor other functions to use OSRelease

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

* Misc refactoring

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-04-14 11:40:28 +02:00
Itxaka
77ed7ba298 🐛 Add missing GetInterfaceIP
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-29 13:46:00 +02:00
Itxaka
2c52e1cda4 🐛 Recover string utils
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-29 13:43:01 +02:00
Itxaka
7a0ac7c663 🐛 Restore missing token utils
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-29 13:34:24 +02:00
Itxaka
ad3c0f6cd6 Add listToOutput misc func
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-17 14:58:04 +01:00
Itxaka
acf490ffed Add misc system func
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-17 14:54:30 +01:00
Itxaka
d2375598d6 Add Prompt and PrintBanner
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-17 14:51:21 +01:00
Itxaka
dfd60b9a02 Add Shell misc util
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-17 14:49:17 +01:00
Itxaka
ec6c3f7443 Add OnSignal misc util
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-17 14:48:23 +01:00
Itxaka
58ddd1c5df Add SetEnv misc util
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-17 14:45:04 +01:00
Itxaka
b3256fa436 Adapt machine to new sdk paths and format
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-17 14:00:02 +01:00
Itxaka
750eed7f93 sparkles: Use kairos-sdk module (#1140) 2023-03-15 15:45:00 +01:00
Ettore Di Giacinto
0344101950 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
Eng Zer Jun
0e989ae7ac 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
bebc9706c4 arrow_up: Bump repository and drop some workarounds (#434)
* ⬆️ Bump Kairos repositories

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>

* 🐧 Find out which grub to call

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
2022-11-16 11:44:18 +01:00
Ettore Di Giacinto
2b7ca66bff sparkles: state api sdk (#262)
*  Add state api

This is related to https://github.com/kairos-io/kairos/issues/34.

Starts to unify the API to retrieve the state in the sdk to have a common place to query system status information.

* 🤖 Add test

* Update go.mod

* ⚙️ Fine-tune detection of partitions

* 🤖 Add more fine-grained tests

* 🎨 Add /dev/ to partition name

* 🤖 Fixup tests

* ⚙️ Remount accessors

*  Add state partition to cloud-init paths

* 📝 Upper case Kairos in motd

* 🎨 Add mounts sdk

* 🎨 Set grub options via SDK

* 🎨 Make it more idiomatic
2022-10-23 20:22:32 +02:00
Ettore Di Giacinto
fa66fa76fa sparkles: Add bundles to post-install hooks (#171)
* 🤖 Add bundles and sysext test

*  Exec bundles also after install

* 🤖 Adapt tests

* 🎨 Create dir only if doesn't exist

* 🎨 Return err on mount

* 🎨 Make bundle errors failure as an option

* 🎨 Minor fixups

* debug

* 🤖 Fix spec

* 🤖 Get correct version for bundle test

* 🎨 Fixups

* 🤖 systemd-sysext is available only on opensuse for now
2022-10-03 00:16:01 +02:00
Ettore Di Giacinto
745c51da9b art: Rebranding (#130)
See: https://github.com/c3os-io/c3os/issues/88
2022-09-17 18:43:51 +02:00
mudler
dd6d5a662b robot: Run only relevant tests, push to core-*
From now on images built from this repo are the c3os core images.
c3os core images contains only the base image, framework files and the c3os agent.

This also sets up tests accordingly to run only to cover the c3os-agent.
2022-08-12 15:49:41 +02:00
mudler
a2a449b325 art: Expose interactive install to providers
In this way install can be driven from providers too

Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-12 12:21:12 +02:00
mudler
a287a0a5ce art: Move out services
Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-12 09:51:46 +02:00
mudler
52cb8cbc29 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
7a148fe5bb
🌱 pass by the container image used in run.sh (#8)
Signed-off-by: mudler <mudler@c3os.io>
2023-03-17 08:16:09 +01:00
Itxaka
5188423783
Bump vfs to 4 (#5) 2023-03-15 12:30:36 +01:00
renovate[bot]
9625bd6059
Add renovate.json (#1)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-15 12:18:20 +01:00
Itxaka
e20e6e13cf 🤖 Only run one job at a time
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-15 12:15:04 +01:00
Itxaka
829a004e42 🤖 Fix lint
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-15 12:13:32 +01:00
Itxaka
61a8e581aa 🤖 Add github jobs
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-15 12:12:54 +01:00
Itxaka
26f3600c40 Add readme and license
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-15 11:54:42 +01:00
Itxaka
3163cfbac0 Extract sdk into its own lib
This had some side effects:

 - Have to add some utils from the kairos/machine modules, which IMHO
   should not be there, they should be here if the are generic enough
 - Dropping the sdk dir, just have the modules in the root dir

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-15 10:56:11 +01:00
Itxaka
227677ba92 Bump ghw and fix state (#1073)
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-09 17:18:37 +01:00
Itxaka
e3269dc88d bug: Update state.go (#987
Update state.go

Remove print leftover

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-01 09:22:24 +01:00
Itxaka
c170fc554a warning: 🎨 Use immucore 🦔 (#877)
* ⚠️ 🎨  Use immucore

Build kairos with immmucore instead of cos-immutable-rootfs

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* 🐛 Fix state sdk

State sdk is using ghw to identify the state of the disks, but
unfortunately ghw only works with devices and not with labels

This patch adds a workaround by checking deeper for partitions that
migth not have mountpoints reported by ghw but are indeed mounted

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* 🐛 Fix state not catching netboot properly

This worked with the old cos-immutable-rootfs due to the rd.cos.disable
stanza in cmdline making the livecd cloud config file trigger, which
created the livecd sentinel file.

With immucore, the sentinel is being created during initramfs directly
so we need to rely on the cmdline to identify it.

State sdk should know that having the netboot stanza should identify the
boot as cdlive

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Fix custom binds set as RW_PATHS

RW_PATHS are meant for overlay dirs which go away after a reboot.
Custom binds/binds are mounted under COS_PERSISTENT, so they persist
after reboot AND are RW by default.

This patch removes adding the custom binds into the RW_PATHS on the
cos-layout file as that can lead to unintended consequences

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Dont run custom mounts on livecd and recovery

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Rework writing custom ephemeral/binds

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Maybe fix tests

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Add missing sgdisk to ubuntu images

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* 🐛 Backport dracut patch for ubuntu 20 iscsi

There was an issue with dracut 48 in which the iscsid.socket required fs
targets to be ready. On an iso this could lead to a dependency cycle
between the dmsquash module setting up the livecd rootfs and the iscsi
socket required the initrd-fs to be ready.

This was fixed on dracut 50 and its what this patch brings, dropping the
socket dependency on the fs target so it can break the dependency cycle.

This only affect ubuntu 20 lts, and only affects booting from the iso.
Alos the issue is random as systemd will decide to break the dependency
in a non predictable way by disabling one of the services that conflict,
so sometimes it would be the iscsi serviec, which would make the iso
boot but sometimes it could be other more important services liek teh
local fs or the dracut pre-mount services.

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
(cherry picked from commit 63f0c75d69ab3adca143f917c2e31b75ca3d96c7)

* Bump immucore

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

---------

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2023-03-01 00:02:10 +01:00
Ettore Di Giacinto
61cc567cd8 seedling: Detect more information about runtime (#956)
* 🌱 Detect more information about runtime

This introduces a `system` and a `kairos` block available in
kairos-agent get state.

This allows for instance to query the agent for the kairos version as
such:

`kairos-agent get state kairos.version`

Part of #755

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

* 🤖 Fixup tests

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

---------

Signed-off-by: mudler <mudler@c3os.io>
2023-02-26 20:18:49 +01:00