rancher / elemental-operator

The Elemental operator is responsible for managing the OS versions and maintaining a machine inventory to assist with edge or baremetal installations.
Apache License 2.0
40 stars 17 forks source link

/etc/rancher/elemental/agent/config.yaml is a JSON file #764

Closed anmazzotti closed 2 months ago

anmazzotti commented 2 months ago
test-btrfs-e5331e3b-1e1b-4ce7-b080-235ed9a6d07c:/ # cat /etc/rancher/elemental/agent/config.yaml 
{"workDirectory":"/var/lib/elemental/agent/work","localPlanDirectory":"/var/lib/elemental/agent/plans","appliedPlanDirectory":"/var/lib/elemental/agent/applied","remoteEnabled":true,"connectionInfoFile":"/var/lib/elemental/agent/elemental_connection.json"}

This currently works miraculously due to the yaml parser in use by the system agent: https://github.com/rancher/system-agent/blob/main/pkg/config/config.go#L11C3-L11C19

If this changes, then we won't be able to parse the config file anymore.

A simple change is to just use the .json extension to name the file.

Another possibility is to extend the forked api and add yaml keys so that we can marshal correctly, but I would not do that until it's also done by the system-agent.