Skip to content

Commit

Permalink
add ability to specify user for rkt
Browse files Browse the repository at this point in the history
  • Loading branch information
chelseakomlo committed Dec 4, 2017
1 parent 619189e commit 23b7042
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ IMPROVEMENTS:
* driver/docker: Adds support for `ulimit` and `sysctl` options [GH-3568]
* driver/docker: Adds support for StopTimeout (set to the same value as
kill_timeout [GH-3601]
* driver/rkt: Add support for passing through user [GH-3612]
* driver/qemu: Support graceful shutdowns on unix platforms [GH-3411]
* template: Updated to consul template 0.19.4 [GH-3543]
* core/enterprise: Return 501 status code in Nomad Pro for Premium end points
Expand Down
5 changes: 5 additions & 0 deletions client/driver/rkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,11 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (*StartResponse,

}

// If a user has been specified for the task, pass it through to the user
if task.User != "" {
prepareArgs = append(prepareArgs, fmt.Sprintf("--user=%s", task.User))
}

// Add user passed arguments.
if len(driverConfig.Args) != 0 {
parsed := ctx.TaskEnv.ParseAndReplace(driverConfig.Args)
Expand Down

0 comments on commit 23b7042

Please sign in to comment.