runservice: remove run step user

Defining an option to override the user for a run step is too much fine grained
and, for consistency, will require to do the same also for the other steps
(clone, *workspace etc...).

Remove it since it's probably enough to define it at the task level.
This commit is contained in:
Simone Gotti 2019-09-11 14:41:53 +02:00
parent d8212eddb0
commit 6d7410cfce
4 changed files with 1 additions and 7 deletions

View File

@ -151,7 +151,6 @@ type RunStep struct {
Environment map[string]Value `json:"environment,omitempty"` Environment map[string]Value `json:"environment,omitempty"`
WorkingDir string `json:"working_dir"` WorkingDir string `json:"working_dir"`
Shell string `json:"shell"` Shell string `json:"shell"`
User string `json:"user"`
} }
type SaveToWorkspaceStep struct { type SaveToWorkspaceStep struct {

View File

@ -115,7 +115,6 @@ fi
rs.Environment = env rs.Environment = env
rs.WorkingDir = cs.WorkingDir rs.WorkingDir = cs.WorkingDir
rs.Shell = cs.Shell rs.Shell = cs.Shell
rs.User = cs.User
return rs return rs
case *config.SaveToWorkspaceStep: case *config.SaveToWorkspaceStep:

View File

@ -117,14 +117,11 @@ func (e *Executor) doRunStep(ctx context.Context, s *types.RunStep, t *types.Exe
shell = s.Shell shell = s.Shell
} }
// try to use the container specified user // use the container specified user and override with task user if defined
user := t.Containers[0].User user := t.Containers[0].User
if t.User != "" { if t.User != "" {
user = t.User user = t.User
} }
if s.User != "" {
user = s.User
}
var cmd []string var cmd []string
if s.Command != "" { if s.Command != "" {

View File

@ -413,7 +413,6 @@ type RunStep struct {
Environment map[string]string `json:"environment,omitempty"` Environment map[string]string `json:"environment,omitempty"`
WorkingDir string `json:"working_dir,omitempty"` WorkingDir string `json:"working_dir,omitempty"`
Shell string `json:"shell,omitempty"` Shell string `json:"shell,omitempty"`
User string `json:"user,omitempty"`
} }
type SaveContent struct { type SaveContent struct {