GetConfig reads and parses the Tempo configuration file that was set up by the harness. Returns the parsed app.Config or an error if reading/parsing fails.
()
| 323 | // GetConfig reads and parses the Tempo configuration file that was set up by the harness. |
| 324 | // Returns the parsed app.Config or an error if reading/parsing fails. |
| 325 | func (h *TempoHarness) GetConfig() (app.Config, error) { |
| 326 | configPath := sharedContainerPath(h.TestScenario, tempoConfigFile) |
| 327 | |
| 328 | buff, err := os.ReadFile(configPath) |
| 329 | if err != nil { |
| 330 | return app.Config{}, fmt.Errorf("failed to read config file: %w", err) |
| 331 | } |
| 332 | |
| 333 | var cfg app.Config |
| 334 | err = yaml.UnmarshalStrict(buff, &cfg) |
| 335 | if err != nil { |
| 336 | return app.Config{}, fmt.Errorf("failed to unmarshal config: %w", err) |
| 337 | } |
| 338 | |
| 339 | return cfg, nil |
| 340 | } |
| 341 | |
| 342 | // restartServiceWithConfigOverlay stops a service, applies a config overlay, and restarts the service. |
| 343 | // The overlay file is merged onto the existing config, with overlay values taking precedence. |