Skip to content

Support Optional includes in configuration file #5297

@cintolas

Description

@cintolas

Proposed change

Currently if the include file is missing, the nats server will fail with a parse error

host: 0.0.0.0
port: $PORT
authorization: {
  token: $TOKEN
}

include ./nats-cluster.conf
PORT=4225 TOKEN="a1234" nats-server -c ~/nats/nats.conf 
nats-server: error parsing include file './nats-cluster.conf', open /home/peter/nats/nats-cluster.conf: no such file or directory

Feature Request

Add a way to specify that this include is optional

include? ./nats-cluster.conf

If the file is missing, continue

Use case

We are creating clusters where High Availability (HA) is optional.
We would like to keep the default configuration as simple as possible and allow the power users to extend the options as needed.

This will allow systemd service files to stay the same since the config file doesn't change

Contribution

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    confproposalEnhancement idea or proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions