Commit Graph

12 Commits

Author SHA1 Message Date
Kenny Root
9b2eeb0e55
Use formatting print to show underlying error message (#500)
* Use formatting print to show underlying error message

This appears to be a typo where "Println" was used instead of "Printf"

Signed-off-by: Kenny Root <kenny@the-b.org>

* Update collector/collector.go

---------

Signed-off-by: Kenny Root <kenny@the-b.org>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2024-09-27 08:37:38 +00:00
Dimitris Karakasilis
a56cb0bb38
Add Sources field to Config (#501)
* Add Sources field to Config

and keep track of merged files there. Also print the Sources as a
comment in the String() method.

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Fix tests

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Fix linter

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Fix TODO

by renaming the toMap function and making it operate on ConfigValues
instead of full Config objects (because after all, it wasn't copying the
Sources field)

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* [minor] Return ConfigValues interface when erroring out

although nobody should consume it since we errored

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Add check for "Sources" comment

to check that these all generate a line:
- cmdline
- remote config (config_url)
- local files

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

---------

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2024-09-26 12:04:21 +03:00
Akvanvig
a578121283
added case for nulling out existing objects with tests (#224)
Signed-off-by: Anders Kvanvig <anders.kvanvig@basefarm-orange.com>
Co-authored-by: Anders Kvanvig <anders.kvanvig@basefarm-orange.com>
2024-07-17 09:27:11 +02:00
Akvanvig
a5a931958b
adjusted query to check if type is null - added test for the case (#114)
Signed-off-by: Anders Kvanvig <anders.kvanvig@basefarm-orange.com>
Co-authored-by: Anders Kvanvig <anders.kvanvig@basefarm-orange.com>
2024-05-23 09:23:37 +03:00
Mauro Morales
14f7a86c1c
Add overwrites (#109)
Relates to kairos-io/kairos#2492

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2024-05-03 18:01:32 +02:00
Akvanvig
5744b1abb2
added check for slice containing items before first item type is checked (#107)
Signed-off-by: Anders Kvanvig <anders.kvanvig@basefarm-orange.com>
Co-authored-by: Anders Kvanvig <anders.kvanvig@basefarm-orange.com>
2024-04-29 10:36:30 +02:00
Itxaka
ce8a9394a7
Return empty query instead of null (#84) 2024-04-11 12:42:03 +02:00
Dimitris Karakasilis
f73090dca2
Don't parse userdata and userdata.yaml (#58)
yip writes both files with the same content when userdata passes
validation (schema.Load):

48147fae9d/pkg/plugins/datasource.go (L246-L252)

This means we shouldn't match `userdata` since the `userdata.yaml` will
be used due to the extension.

Fixes https://github.com/kairos-io/kairos/issues/2019

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2023-11-23 16:37:37 +02:00
Itxaka
8f54324703
Allow passing readers to collector (#52) 2023-09-26 09:32:53 +02:00
Itxaka
699aa6203c
Read the first ten lines of a config to check for headers (#51)
There could be comments before the cloud-config header or jinja
expressions as we found already[0] so our current header check its a bit
strict.

This patch makes it so er read the first ten lines of the config source,
check for # at the start and then check for the headers as we did
before, so we are a bit more letinent in case the cloud-config header is
not the first thing in the file

Signed-off-by: Itxaka <itxaka@kairos.io>
2023-09-15 20:59:31 +02:00
Mauro Morales
396c5553ca
🐛 Wrong deep merge when array contains maps (#38)
* Do not try to smart merge arrays, but just append them

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

* Fix tests

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

* Rewording for tests

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

* Rename function to match what is doing after refactoring

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

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
2023-08-01 10:08:21 +02:00
Itxaka
dcf352a009
Bring collector into the sdk (#31) 2023-06-14 13:01:06 +02:00