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

log_driver and log_opt moved to logging key. #2561

Merged

Conversation

dbonev
Copy link

@dbonev dbonev commented Dec 19, 2015

Moving log_driver and log_opt to a new logging key:

logging:
    driver:
    options:

Implements #2503

Signed-off-by: Dimitar Bonev dimitar.bonev@gmail.com

@dbonev dbonev force-pushed the 2503-move-logging-config-under-separate-key branch from fc2eabc to ac8825b Compare December 19, 2015 16:39
logging_dict = container_options['logging']
container_options['log_driver'] = logging_dict.get('driver', "")
container_options['log_opt'] = logging_dict.get('options', None)
del container_options['logging']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if we didn't perform mutation in a utility function like this, as long as there's a nice way to do it without. Maybe:

  1. Move 'logging' out of DOCKER_CONFIG_OPTIONS and into ALLOWED_KEYS.
  2. In in _get_container_create_options:
container_options.update(self.get_logging_options())
  1. get_logging_options:

    def get_logging_options(self):
        logging_dict = self.options.get('logging', {})
        return {
            'log_driver': logging_dict.get('driver', ""),
            'log_opt': logging_dict.get('options', None),
        }

@aanand
Copy link

aanand commented Dec 21, 2015

Nice, thanks. Ideally the logging key would only apply for users of the new file format, so this is blocking on #2421. You could implement it on top of that branch so that it's ready to go once that PR is merged.

@dbonev dbonev force-pushed the 2503-move-logging-config-under-separate-key branch 2 times, most recently from 189b4ed to ee1f7b2 Compare December 21, 2015 20:07
@dbonev
Copy link
Author

dbonev commented Dec 21, 2015

@aanand Thanks for the feedback.

I'd prefer if we didn't perform mutation in a utility function like this, as long as there's a nice way to do it without.

Note taken -- did it this way.

so this is blocking on #2421.

I'll make sure it applies cleanly on top of #2421 branch.
Thanks.

Signed-off-by: Dimitar Bonev <dimitar.bonev@gmail.com>
@dbonev dbonev force-pushed the 2503-move-logging-config-under-separate-key branch from ee1f7b2 to ed5f7bd Compare January 8, 2016 00:07
@aanand aanand merged commit ed5f7bd into docker:master Jan 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants