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:
parent
d8212eddb0
commit
6d7410cfce
|
@ -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 {
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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 != "" {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue