* Bump go in Earthly and workflows to ^1.20
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update go.mod version
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Lint
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Remove pin of go version to get the latest
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Remove minor version
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>
* 🌱 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>
* Validate yaml
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* lint feedback
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Validate User name with JsonSchema
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* WIP users validation
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add multiple examples for ssh keys
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add example of complex validation with AnyOf
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Better business rule example with P2P
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Test with message for empty network_token
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Split into a file for each sub section
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add install schema validations
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add to main schema
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add more tests for p2p
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add install schema
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Validate fields between new and old schema
It also adds the missing ones
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Lint
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Remove temp debugging functions
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add new fields in old schema
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add documentation for all exported
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Move schemas into a directory of their own
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add missing dot at end of comment
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Rebase master and add local_file to bundles
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update module github.com/erikgeiser/promptkit to v0.8.0
* 🎨 Adapt agent to new v0.8.0 promptkit version
Validation function for textinput now requires an error/nil instead of
a bool
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Itxaka <itxaka@spectrocloud.com>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
* 🔧 Enable spice in scripts/start_vm_qemu.sh
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 add option specify display for qemu
This works only with https://github.com/spectrocloud/peg/pull/2
merged.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 add option to enable KVM
ISO=/home/oznt/Software/spectro-cloud/kairos/build/kairos-core-opensuse.iso \
CREATE_VM=true USE_QEMU=true \
MACHINE_DISPLAY="-vga qxl -spice port=5903,addr=127.0.0.1,disable-ticketing=yes" \
KVM=true ginkgo run -v tests
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Fix failing tests - qemu does not have /dev/sda
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Update peg dependency
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
adding better windows desktop support for the project
Signed-off-by: Luther Monson <luther.monson@gmail.com>
Signed-off-by: Luther Monson <luther.monson@gmail.com>
* ✨ 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
* 🐛 Fixup grub option quoting
* ⚙️ Copy discovery to oem if found
* ✨ Add environment block to install
* ⚙️ Use /oem for mount in kcrypt post-hook
* 📝 Update docs with installer env reference
* 🤖 Add test deps
* ⚙️ Be consistent and set env also for post-hooks
* ⚙️ propagate env in post-hooks
* 🤖 Run datasource tests on CircleCI
* 🤖 Run bundles tests on CircleCI
* 🤖 Fixups
* 🤖 Run cli tests to CircleCI
* 🤖 Extend wait time
* 🤖 Fail when VM is aborted
* 🤖 Enlart waiting time window
* 🤖 Do not set VM specs
* 🤖 Shift just some of the tests
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.
This changeset also adds a `config_url` and `options` keyword in the c3os config.
Along with that the config logic is changed so the configuration is taken also from boot commands and merged in the final installed config file.
* 🎨 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