Skip to content

Commit

Permalink
Merge pull request #2702 from hashicorp/add-no-overlay-option
Browse files Browse the repository at this point in the history
Add no overlay option
  • Loading branch information
schmichael committed Jun 9, 2017
2 parents 143769e + 9f362d6 commit 32804bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/driver/rkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ type RktDriverConfig struct {
Volumes []string `mapstructure:"volumes"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container
InsecureOptions []string `mapstructure:"insecure_options"` // list of args for --insecure-options

Debug bool `mapstructure:"debug"` // Enable debug option for rkt command
NoOverlay bool `mapstructure:"no_overlay"` // disable overlayfs for rkt run
Debug bool `mapstructure:"debug"` // Enable debug option for rkt command
}

// rktHandle is returned from Start/Open as a handle to the PID
Expand Down Expand Up @@ -156,6 +157,9 @@ func (d *RktDriver) Validate(config map[string]interface{}) error {
"volumes": &fields.FieldSchema{
Type: fields.TypeArray,
},
"no_overlay": &fields.FieldSchema{
Type: fields.TypeBool,
},
"insecure_options": &fields.FieldSchema{
Type: fields.TypeArray,
},
Expand Down Expand Up @@ -280,6 +284,11 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e

cmdArgs = append(cmdArgs, "run")

// disable overlayfs
if driverConfig.NoOverlay {
cmdArgs = append(cmdArgs, "--no-overlay=true")
}

// Write the UUID out to a file in the state dir so we can read it back
// in and access the pod by UUID from other commands
uuidPath := filepath.Join(ctx.TaskDir.Dir, "rkt.uuid")
Expand Down
3 changes: 3 additions & 0 deletions website/source/docs/drivers/rkt.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ The `rkt` driver supports the following configuration in the job spec:

* `debug` - (Optional) Enable rkt command debug option.

* `no_overlay` - (Optional) When enabled, will use `--no-overlay=true` flag for 'rkt run'.
Useful when running jobs on older systems affected by https://github.com/rkt/rkt/issues/1922

* `volumes` - (Optional) A list of `host_path:container_path` strings to bind
host paths to container paths.

Expand Down

0 comments on commit 32804bd

Please sign in to comment.