Commit Graph

4 Commits

Author SHA1 Message Date
Itxaka
ef0c14006b bug: Fix agent not able to get subkeys (#1299)
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-04-15 13:45:13 +02:00
Mauro Morales
b8b3e83ef1 bug: Do not merge all cmdline arguments to generic config (#1256)
* Do not merge all cmdline arguments to generic config

Instead allow only specific Kairos config ones, this should not be known by the collector but doing it this way as a temporary hack to release 2.0 and then we can do properly

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

* Remove fmt.Println

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

* Lint

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

* imports

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

* Filter using a cloud config structure

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

* Pass a filter function

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

* Exclude collector config from config.Config yaml

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

* Fix issue with test now that a yaml tag gets ignored

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

* cleanup FilterKeys func

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

* Add comment

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-04-06 15:18:15 +02:00
Dimitris Karakasilis
d7fc1ee026 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
b513c69a0c 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