* Pass VERSION flag including v2 in path
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Pass VERSION flag including v2 in path for goreleaser
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add version to goreleaser
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* do not remove github token
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* include version in dist target
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add missing flag to pass the version
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* 🎨 Change kairos agent release name and sign sha256
This patch changes the release artifact to be named kairos-agent instead
of just kairos, so its clear what the archive is referring to.
Also adds cosign signatures to the iso sha256 files so users can confirm
they havent been tampered with
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
* Add docs for signature and checksum verification for ISO
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
* Update version used for signing docs
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
Co-authored-by: Itxaka <itxaka@spectrocloud.com>
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.
* 🎨 Split off cli into separate binaries
This commit splits off the cli into 3 binaries:
- agent
- cli
- provider
The provider now is a separate component that can be tested by itself
and have its own lifecycle. This paves the way to a ligher c3os variant,
HA support and other features that can be provided on runtime.
This is working, but still there are low hanging fruit to care about.
Fixes#14
* 🤖 Add provider bin to releases
* ⚙️ Handle signals
* ⚙️ Reduce buildsize footprint
* 🎨 Scan for providers also in /system/providers
* 🤖 Run goreleaser
* 🎨 Refactoring
* 🐛 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>
* Use site variables to update image flavor and name
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Typo
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Prefix variable names with distro name in os-release
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Adapt tests to read os-release with prefix
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Adapt docs to show how to read os-release with prefix
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update SDK to be aware of attr prefixes
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Adapt test with new variable names
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Temporarily print the os-release
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Check KAIROS_VERSION on tests and fallback to VERSION
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Match kubo ID and VERSION_ID
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Make kubo extension match any ID
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Test still fails, trying with surrounding quotes
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Reduce tests wait time
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Use tumbleweed for bundles tests
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update docs about systemd-sysext
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* reduce wait time in reset tests
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
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>
* 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>
Looks like yip 1.x is not working as expected, skipping stages and
whatnot
This downgrades it to a know working 0.11.x version until those issues
are fixed
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Refactor tests to use the "VM" construct from peg
📖 Add cloud-config.json for v1.6.0 (#977)
:docs: Add cloud-config.json for v1.6.0
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
📖 Add documentation about schema validation (#978)
* 📖 Add documentation for cloud config validation
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add image
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Move image to static dir
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
🐛 Backport dracut patch for ubuntu 20 iscsi (#979)
🔧 Use random free port for Spice display and SSH
When running the install test with qemu, the second test will
fail because the 2nd machine will fail to start.
The failure is cause because the port of the previous machine is
still not freed.
Hence, let the install-test use a differnet random port if not
specified.
`GetFreePorts` copied from `kairos-io/kcrypt-challenger`.
Credits @jimmykarily.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Update peg and use new VM interface
This enables creating mulitple VMs in parallel
as done in kairos-io/kcrypt-challenger.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Handle possible collision of spice and SSH ports
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Migrate all tests to new PEG API
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Remove one more reference to old API.
Replace Machine.SendFile with vm.Scp
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Try and fix bundle_tests
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Temporarily disable many flavours
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Bump peg and fix code
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Remove unecessary output and fix test issues
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Make sure we install before we start checking things.
It seems that we were relying on previous tests to do the installation
because we only had one "Machine".
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Bump peg to better handle "Sudo", dedup tests
and make sure installation has happened before every check
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Wait until systemd service becomes active
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Merge multiple similar tests into one
because the big overhead comes from the BeforeEach block which is the
same in all tests. The tests themselves are just checking differnet
things on similar VMs. By merging them we same a lot of time in
preparing the same env again and again.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix forgotten "Machine"
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Bring all flavors back
This partly reverts commit aa029c20acd79c46122783aad030e2a5410a9374.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Merge similar tests an uncomment code
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix fogotten global Machine function
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Wait for systemd-sysext to do its thing
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix forgotten global Sudo and remove gatherLogs
which wasn't working anyway
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fixes after rebase
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix `source` not present in ubuntu/debian `/bin/sh`
and add debug output to failed test
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Bump peg to fix "read only filesystem" error in tests
50b63c0bf8
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Use "." instead of "source" in vm's "/bin/sh"
because "source" is not recognised in debian based flavors
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Bump peg to fix vm.Sudo problems
and remove redundant check.
Now peg just pipes the ssh command without creating tmp scripts
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
---------
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* ⚠️🎨✨ 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>
* 🌱 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>