From c7f3a463c68bfac752a4f2a87ef634e2914f19b2 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Thu, 21 Mar 2019 10:05:22 +0100 Subject: [PATCH] Refactoring: move docker driver Simulate field as a config parameter. Signed-off-by: Silvin Lubecki --- pkg/driver/docker_driver.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/driver/docker_driver.go b/pkg/driver/docker_driver.go index b3803e4f..74769917 100644 --- a/pkg/driver/docker_driver.go +++ b/pkg/driver/docker_driver.go @@ -23,9 +23,7 @@ import ( // DockerDriver is capable of running Docker invocation images using Docker itself. type DockerDriver struct { - config map[string]string - // If true, this will not actually run Docker - Simulate bool + config map[string]string dockerCli command.Cli dockerConfigurationOptions []DockerConfigurationOption } @@ -48,6 +46,7 @@ func (d *DockerDriver) AddConfigurationOptions(opts ...DockerConfigurationOption // Config returns the Docker driver configuration options func (d *DockerDriver) Config() map[string]string { return map[string]string{ + "SIMULATE": "If enabled (0|1), this will actually prevent Docker from running", "VERBOSE": "Increase verbosity. true, false are supported values", "PULL_ALWAYS": "Always pull image, even if locally available (0|1)", "DOCKER_DRIVER_QUIET": "Make the Docker driver quiet (only print container stdout/stderr)", @@ -119,7 +118,7 @@ func (d *DockerDriver) exec(op *Operation) error { return err } - if d.Simulate { + if d.config["SIMULATE"] == "1" { return nil } if d.config["PULL_ALWAYS"] == "1" {