From 038a1bc2f95534a9e7a872b13d862c09358a11fd Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Fri, 18 Mar 2016 15:04:15 -0700 Subject: [PATCH] Added some comments --- client/driver/executor/executor.go | 3 +++ client/driver/executor/executor_test.go | 2 +- client/driver/structs/structs.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go index 7afcef812..ceba6b0ea 100644 --- a/client/driver/executor/executor.go +++ b/client/driver/executor/executor.go @@ -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 diff --git a/client/driver/executor/executor_test.go b/client/driver/executor/executor_test.go index 8798170e7..629a930af 100644 --- a/client/driver/executor/executor_test.go +++ b/client/driver/executor/executor_test.go @@ -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) diff --git a/client/driver/structs/structs.go b/client/driver/structs/structs.go index e304fd679..a23990427 100644 --- a/client/driver/structs/structs.go +++ b/client/driver/structs/structs.go @@ -7,6 +7,7 @@ import ( ) const ( + // The default user that the executor uses to run tasks DefaultUnpriviledgedUser = "nobody" )