opendut icon indicating copy to clipboard operation
opendut copied to clipboard

EDGAR: Write configuration prevents EDGAR to start if there are other properties already configured.

Open mtwardawski opened this issue 1 year ago • 1 comments

Right now we are setting some configuration in the edgar.toml when we provide a setup string. (opendut-edgar/src/setup/tasks/write_configuration.rs)

  • peer.id
  • network.carl.host
  • network.carl.port
  • network.oidc.enabled
  • network.oidc.client.id
  • network.oidc.client.secret

If there is already an edgar.toml at that location, we cannot start EDGAR without getting a hint for a merged toml file, but as far we could observe, this toml file does not contain other variables which were already in that existing toml file and we might need to get EDGAR properly running.

AC:

  • EDGAR can manage other variables properly which are already defined in an edgar.toml
  • EDGAR can start with the newly written (merged) config
  • make sure, all variable in the toml file are still existent and nothing is missing

mtwardawski avatar May 02 '24 07:05 mtwardawski

We use the toml_edit crate during Setup to make as minimal changes to the existing configuration on disk as possible. If no changes had to be made to the existing configuration, then it should match verbatim to what's on disk, which we detect and then EDGAR should continue the Setup:

https://github.com/eclipse-opendut/opendut/blob/4bbccce16e5136f2e6cc8401bec5810a5f92f9a1/opendut-edgar/src/setup/tasks/write_configuration.rs#L94-L97

It's possible that toml_edit isn't quite as precise here. Do you have the error message from when this happened, or steps to reproduce it?

mbfm avatar May 06 '24 11:05 mbfm

Resolved by 648e7f62975230b312da04e38ba832cf8e6375f7.

mbfm avatar Dec 18 '24 10:12 mbfm