Added some comments

This commit is contained in:
Diptanu Choudhury 2016-03-18 15:04:15 -07:00
parent ddbf18f02a
commit 038a1bc2f9
3 changed files with 5 additions and 1 deletions

View File

@ -211,6 +211,7 @@ func (e *UniversalExecutor) Wait() (*ProcessState, error) {
return e.exitState, nil
}
// COMPAT: prior to Nomad 0.3.2, UpdateTask didn't exist.
// UpdateLogConfig updates the log configuration
func (e *UniversalExecutor) UpdateLogConfig(logConfig *structs.LogConfig) error {
e.ctx.Task.LogConfig = logConfig
@ -230,6 +231,8 @@ func (e *UniversalExecutor) UpdateLogConfig(logConfig *structs.LogConfig) error
func (e *UniversalExecutor) UpdateTask(task *structs.Task) error {
e.ctx.Task = task
// Updating Log Config
fileSize := int64(task.LogConfig.MaxFileSizeMB * 1024 * 1024)
e.lro.MaxFiles = task.LogConfig.MaxFiles
e.lro.FileSize = fileSize

View File

@ -125,7 +125,7 @@ func TestExecutor_IsolationAndConstraints(t *testing.T) {
execCmd.FSIsolation = true
execCmd.ResourceLimits = true
execCmd.User = "nobody"
execCmd.User = cstructs.DefaultUnpriviledgedUser
executor := NewExecutor(log.New(os.Stdout, "", log.LstdFlags))
ps, err := executor.LaunchCmd(&execCmd, ctx)

View File

@ -7,6 +7,7 @@ import (
)
const (
// The default user that the executor uses to run tasks
DefaultUnpriviledgedUser = "nobody"
)