Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Configs): Allow hierarchical notation in JSON/YAML configs #7498

Merged
merged 8 commits into from
Mar 4, 2021

Conversation

karlmcguire
Copy link
Contributor

@karlmcguire karlmcguire commented Mar 1, 2021

(DGRAPH-3078)

If users want the ability to use hierarchical notation in JSON and YAML --config files they can now do so. If not, they can use the SuperFlag string notation as well.


JSON:

{
  "mutations": "strict",
  "badger": {
    "compression": "zstd:1",
    "goroutines": 5
  },
  "raft": {
    "idx": 2,
    "learner": true
  },
  "security": {
    "whitelist": "127.0.0.1,0.0.0.0"
  }
}

Is converted into:

{
  "mutations": "strict",
  "badger": "compression=zstd:1; goroutines=5;",
  "raft": "idx=2; learner=true;",
  "security": "whitelist=127.0.0.1,0.0.0.0;"
}

YAML:

mutations: strict
badger:
  compression: zstd:1
  goroutines: 5
raft:
  idx: 2
  learner: true
security:
  whitelist: "127.0.0.1,0.0.0.0"

Is converted into:

mutations: strict
badger: "compression=zstd:1; goroutines=5;"
raft: "idx=2; learner=true;"
security: "whitelist=127.0.0.1,0.0.0.0;"

This change is Reviewable

@karlmcguire karlmcguire changed the title fix(Configs): Allow hierarchical notation in YAML config files fix(Configs): Allow hierarchical notation in JSON/YAML configs Mar 2, 2021
@karlmcguire karlmcguire marked this pull request as ready for review March 2, 2021 21:33
@karlmcguire karlmcguire merged commit 016848f into master Mar 4, 2021
@karlmcguire karlmcguire deleted the karl/configs branch March 4, 2021 18:37
aman-bansal pushed a commit that referenced this pull request Mar 9, 2021
config.yaml/yml and config.json files used with the --config flag can now use hierarchical notation for SuperFlags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant