Comments (7)
Assuming precedence is by lexical/alnum sort descending, I'd expect highest (last) precedence to win when the same directive is given multiple times, not lowest (first) precedence.
from ziti.
You don't want config merging a la Docker Compose? That was my mental model for this until you say no merging. 🙂
from ziti.
In your model, if first is highest precedence then included configs are always additive, and individual, included directives are ignored unless they're the first occurrence, correct? So, the descending sort also has descending precedence, and last is lowest.
from ziti.
Merging is hard to handle & I'd rather have a consistent way to load separate distinct overrides than merge multiple ones.
For the sorting the files, I'm following sudoers example:
Files are parsed in sorted lexical order. That is, /etc/sudoers.d/01_first will be parsed before /etc/sudoers.d/10_second.
They use lexical order in ascending for sorting the files.
In my model, you could create a default configuration with the include at the top, before any keys & anything loaded from file would override the default values in the configuration.
from ziti.
I like the admin experience you're going for. I'm still fuzzy on precedence. If lower sorted includes can't cancel/override a config property that's already defined then they're lower precedence by definition, i.e., not "overrides." Did I misunderstand?
from ziti.
Maybe an example would be better.
The default config contains:
v: 3
include:
directory: /opt/openziti/config.d
extension: yml
events:
jsonLogger:
subscriptions: jsonLogger:
subscriptions:
- type: fabric.circuits
...
interval: 25s
handler:
type: file
format: json
path: /tmp/ziti-25s-events.log
...
When the controller starts up, it would find the include key & would read the files in the specified directory. It wouldn't find any files so it would continue to read the default config & load the events
key with the 25s interval & something like the following would be in the logs:
[INFO] - found include key but unable to load any files from specified directory.
Someone creates a file called events.yml
in the specified directory with the content:
events:
jsonLogger:
subscriptions: jsonLogger:
subscriptions:
- type: fabric.circuits
...
interval: 60s
handler:
type: file
format: json
path: /tmp/ziti-60s-events.log
Sorting in lexical order of files.
events.yml
When the controller restarts, the controller would see the Include before reading events
key in the default config & would read the files in the specified directory. It would find events.yml
& load the events
key with the 60s interval & ignore the default events
with the 25s interval & something like the following would be in the logs:
[INFO] - loaded events
from /opt/openziti/config.d/events.yml
[ERROR] - found duplicate key events
- ignoring
Then someone drops another file called 01-events.yml
in the specified directory with the content:
events:
jsonLogger:
subscriptions: jsonLogger:
subscriptions:
- type: fabric.circuits
...
interval: 5s
handler:
type: file
format: json
path: /tmp/ziti-5s-events.log
Sorting in lexical order of files.
01-events.yml
events.yml
When the controller restarted, you would end up with a 5s interval & something like the following would be in the logs:
[INFO] - loaded events
from /opt/openziti/config.d/01-events.yml
[ERROR] - found duplicate key events
- ignoring
[ERROR] - found duplicate key events
- ignoring
from ziti.
I've got it now. The proposed logic is to first seek and find and load any lexically-sorted includes, then load the default configuration. This means the includes have the highest precedence and are always loaded first, and any defaults in the main config.yml are only loaded if not already defined.
from ziti.
Related Issues (20)
- Update Enrollment Processes For HA
- delete of non-existent entity causes panic when run on follower controller
- Implement subscriber model for identity/service events in router HOT 1
- support IPv4 address for controller and router package and container image HOT 3
- renew the controller's leaf certs at interval
- override controller and router run args
- add CITATION.cff HOT 2
- redress how controller db bootstrapping works
- support alt server certs in Linux and Docker deployments
- JWKS endpoints may not refresh on new KID
- hint how to deploy a private router
- uninstall router scriptlet fails to remove temp file
- linux router - require ctrl address HOT 1
- Identities for edge routers with tunneling enabled sometimes show hasEdgeRouterConnection=false even though everything is OK
- Add config information to router data model HOT 2
- harden, scan, and attest container images
- let router deployments have separate edge and link ports
- Support mechanism for sticky dials
- add container or guidance for prod Docker controller w/ console HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ziti.