haveachin/infrared

Defaults override individual server configs

6ixfalls opened this issue · 2 comments

Describe the bug
Defining defaults overrides any values you set in a server; this should be the other way around, where the explicit values set in the server override the defaults.

To Reproduce
What OS are you using?
Dockerized (Kubernetes)

What version of Infrared are you using?
rewrite 2.0.0-alpha.14

What do your Infrared proxy config(s) look like?
Should be reproducable with a simple config:

defaults:
  java:
    server:
      dialTimeoutMessage: Random message default.
java:
  servers:
    test:
      dialTimeoutMessage: What should be shown.

(required values not shown)

How do you trigger the bug/issue?
You can call the /v1/configs/reload endpoint to see that "What should be shown." does not show up under the server block. In addition, you can try connecting, and the second message won't be shown. You can also remove the dialTimeoutMessage from defaults; in that case, "What should be shown." is shown as well as in the API.

Expected behavior
"What should be shown." should be the timeout message, the server block should override the defaults.

That's odd. I'm gonna look into it.

This version of Infrared will no longer be supported. Sorry for any inconvenience.