You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, enabled log drivers are parsed from a comma-separated list and placed in an array of strings. Those strings are then used as property indexes on a LOG_DRIVERS object.
This breaks if there were any spaces in the comma-separated list of drivers, "json-file, none, gets split(",") that results in ["json-file", " none"] which eventually leads to LOG_DRIVERS.hasOwnProperty(" none") and that ultimately leads to assertion failure.
Here's the snippet of code that does the validation of log drivers.
if(config.enabledLogDrivers){assert.string(config.enabledLogDrivers,'config.enabledLogDrivers-raw');config.enabledLogDrivers=config.enabledLogDrivers.split(',');}else{config.enabledLogDrivers=['json-file'];}assert.arrayOfString(config.enabledLogDrivers,'config.enabledLogDrivers');config.enabledLogDrivers.forEach(function_checkLogDriver(driver){assert.ok(common.LOG_DRIVERS.hasOwnProperty(driver),'config.enabledLogDrivers.'+driver+' is not a valid driver');});
A valid fix is to trim each log driver from the comma-separated list after it's been converted into an array:
ynnadrules
changed the title
Spaces in config.enabledLogDrivers causes sdc-docker service to fail to start
Spaces in enabledLogDrivers list causes sdc-docker service to fail to start
Jan 31, 2017
Currently, enabled log drivers are parsed from a comma-separated list and placed in an array of strings. Those strings are then used as property indexes on a
LOG_DRIVERS
object.This breaks if there were any spaces in the comma-separated list of drivers,
"json-file, none
, getssplit(",")
that results in["json-file", " none"]
which eventually leads toLOG_DRIVERS.hasOwnProperty(" none")
and that ultimately leads to assertion failure.Here's the snippet of code that does the validation of log drivers.
A valid fix is to trim each log driver from the comma-separated list after it's been converted into an array:
The text was updated successfully, but these errors were encountered: