kairos-agent/internal/agent
Oz Tiram 6e5c87a717 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
..
hooks sparkles: custom user bind and ephemeral mounts (#692) 2023-02-03 11:04:02 +01:00
agent_options.go art: Make linter happy 2022-08-08 08:32:11 +00:00
agent_suite_test.go robot: Add agent config bootstrap test 2022-11-27 14:34:36 +01:00
agent_test.go robot: Add agent config bootstrap test 2022-11-27 14:34:36 +01:00
agent.go seedling: Webui installer (#587) 2023-01-05 14:15:05 +01:00
config.go seedling: Webui enhancements (#620) 2023-01-08 21:49:23 +01:00
iconunix.go seedling: Webui enhancements (#620) 2023-01-08 21:49:23 +01:00
install.go require userdata loaded before running install (#742) 2023-01-30 08:12:11 -07:00
interactive_install.go seedling: Drop references to node-config (#697) 2023-01-20 19:14:53 +01:00
make_art.sh gear: Setup log rotation 2022-07-17 08:42:12 +00:00
notify.go art: Rebranding (#130) 2022-09-17 18:43:51 +02:00
recovery.go added support for fast mode (#168) 2022-09-30 17:23:10 -07:00
reset.go sparkles: Add reset hook (#723) 2023-01-25 13:38:56 +01:00
upgrade.go Upgrade to latest release if one is not specified and ask user to confirm (#389) 2022-11-07 20:28:33 +02:00