a49bf24abe
Overriding configuration parameters with environment variables used to work by walking the configuration structure and checking for a corresponding environment variable for each item. This was very limiting because only variables corresponding to items that already existed in the configuration structure would be checked. For example, an environment variable corresponding to nested maps would only be noticed if the outer map's key already existed. This commit changes environment variable overriding to iterate over the environment instead. For environment variables beginning with the REGISTRY_ prefix, it splits the rest of their names on "_", and interprets that as a path to the variable to unmarshal into. Map keys are created as necessary. If we encounter an empty interface partway through following the path, it becomes an implicit map[string]interface{}. With the new unit tests added here, parser.go now has 89.2% test coverage. TestParseWithExtraneousEnvStorageParams was removed, because the limit of one storage driver is no longer enforced while parsing environment variables. Now, Storage.Type will panic if multiple drivers are specified. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com> |
||
---|---|---|
.. | ||
images | ||
osx | ||
spec | ||
storage-drivers | ||
apache.md | ||
architecture.md | ||
building.md | ||
configuration.md | ||
deploying.md | ||
Dockerfile | ||
glossary.md | ||
help.md | ||
index.md | ||
insecure.md | ||
introduction.md | ||
Makefile | ||
migration.md | ||
mirror.md | ||
nginx.md | ||
notifications.md | ||
osx-setup-guide.md | ||
recipes.md | ||
storagedrivers.md | ||
test.compare.md | ||
test.md |