* 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>
* 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>
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>
* 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>