Project

General

Profile

Actions

Bug #10282

closed

[Go programs]Warn or error when unrecognized keys appear in config files

Added by Tom Clegg over 7 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
-
Story points:
1.0

Description

Currently, if a configuration key is misspelled or misplaced in a configuration file, it is silently ignored.

Programs that read configuration files should print a warning message when this happens, to avoid running services with configuration different than intended. Support an optional flag which converts the warning to an error and causes the program to exit.

There is a Go feature in the works that would be helpful. Even with that, we'd still need our YAML library to expose DisallowUnknownFields() -- either that, or convert YAML → map[string]interface{} → JSON and then load the resulting JSON to the real struct using DisallowUnknownFields().

If we don't want to wait, we could detect invalid keys by comparing site config to example config (but do not read the example config from /etc at runtime -- rather, build the example config into the Go binary). Load both configs into a map[string]interface{}, then do a recursive "A's keys are a subset of B's keys" test.


Related issues

Related to Arvados - Feature #10594: [API] [Workbench] Error out when unrecognized keys appear in config filesNewActions
Related to Arvados - Idea #15003: [config] Go package & tool for preprocessing cluster config fileResolvedTom Clegg04/26/2019Actions
Blocked by Arvados - Feature #10141: [Packaging] Include sample config file (/etc/arvados/foo/foo.example.yml) with each configurable packageClosed09/28/2016Actions
Actions #1

Updated by Tom Clegg over 7 years ago

  • Description updated (diff)
Actions #2

Updated by Tom Morris over 7 years ago

  • Assigned To set to Tom Morris
  • Target version set to Arvados Future Sprints
Actions #3

Updated by Tom Clegg over 7 years ago

  • Subject changed from Log a warning when unrecognized keys appear in config files to Error out when unrecognized keys appear in config files
  • Description updated (diff)
Actions #4

Updated by Tom Clegg over 7 years ago

  • Description updated (diff)
  • Subject changed from Error out when unrecognized keys appear in config files to [Go programs] Error out when unrecognized keys appear in config files
Actions #5

Updated by Tom Morris about 5 years ago

  • Assigned To deleted (Tom Morris)
  • Target version changed from Arvados Future Sprints to To Be Groomed
Actions #6

Updated by Tom Morris almost 5 years ago

  • Subject changed from [Go programs] Error out when unrecognized keys appear in config files to [Go programs]Warn or error when unrecognized keys appear in config files
  • Description updated (diff)
  • Target version changed from To Be Groomed to Arvados Future Sprints
  • Story points set to 1.0
Actions #7

Updated by Tom Clegg almost 5 years ago

  • Related to Idea #15003: [config] Go package & tool for preprocessing cluster config file added
Actions #8

Updated by Tom Clegg almost 5 years ago

obsoleted/replaced by #15003

Actions #9

Updated by Tom Clegg almost 5 years ago

  • Status changed from New to Feedback
Actions #10

Updated by Tom Clegg almost 5 years ago

  • Status changed from Feedback to Closed
Actions #11

Updated by Tom Morris almost 5 years ago

  • Target version deleted (Arvados Future Sprints)
Actions

Also available in: Atom PDF