diff --git a/pkg/driver/docker_driver.go b/pkg/driver/docker_driver.go index 720e5a63..02be8e85 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 containerOut io.Writer @@ -50,6 +48,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)", @@ -131,7 +130,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" { diff --git a/pkg/driver/driver_test.go b/pkg/driver/driver_test.go index 3c3400f1..9d07fce9 100644 --- a/pkg/driver/driver_test.go +++ b/pkg/driver/driver_test.go @@ -55,7 +55,7 @@ func TestDockerDriver_Run(t *testing.T) { d, err := Lookup("docker") // Don't actually run Docker - d.(*DockerDriver).Simulate = true + d.(*DockerDriver).SetConfig(map[string]string{"SIMULATE": "1"}) is := assert.New(t) is.NoError(err)