Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Refactoring: move docker driver Simulate field as a config parameter.
Browse files Browse the repository at this point in the history
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
  • Loading branch information
silvin-lubecki committed Mar 21, 2019
1 parent 92a8228 commit c7f3a46
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/driver/docker_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)",
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit c7f3a46

Please sign in to comment.