runservice: add option to define custom container entrypoint
This commit is contained in:
parent
16ac6ada66
commit
b05b377d31
|
@ -71,6 +71,7 @@ type Container struct {
|
|||
Environment map[string]string `yaml:"environment,omitempty"`
|
||||
User string `yaml:"user"`
|
||||
Privileged bool `yaml:"privileged"`
|
||||
Entrypoint string `yaml:"entrypoint"`
|
||||
}
|
||||
|
||||
type Pipeline struct {
|
||||
|
|
|
@ -37,6 +37,7 @@ func genRuntime(c *config.Config, runtimeName string) *rstypes.Runtime {
|
|||
Environment: cc.Environment,
|
||||
User: cc.User,
|
||||
Privileged: cc.Privileged,
|
||||
Entrypoint: cc.Entrypoint,
|
||||
})
|
||||
}
|
||||
return &rstypes.Runtime{
|
||||
|
|
|
@ -438,6 +438,12 @@ func (e *Executor) executeTask(ctx context.Context, et *types.ExecutorTask) {
|
|||
return
|
||||
}
|
||||
|
||||
cmd := []string{toolboxContainerPath, "sleeper"}
|
||||
if et.Containers[0].Entrypoint != "" {
|
||||
cmd = strings.Split(et.Containers[0].Entrypoint, " ")
|
||||
log.Infof("cmd: %v", cmd)
|
||||
}
|
||||
|
||||
log.Debugf("starting pod")
|
||||
podConfig := &driver.PodConfig{
|
||||
Labels: createTaskLabels(et.ID),
|
||||
|
@ -445,7 +451,7 @@ func (e *Executor) executeTask(ctx context.Context, et *types.ExecutorTask) {
|
|||
Containers: []*driver.ContainerConfig{
|
||||
{
|
||||
Image: et.Containers[0].Image,
|
||||
Cmd: []string{toolboxContainerPath, "sleeper"},
|
||||
Cmd: cmd,
|
||||
Env: et.Containers[0].Environment,
|
||||
WorkingDir: et.WorkingDir,
|
||||
User: et.Containers[0].User,
|
||||
|
|
|
@ -425,6 +425,7 @@ type Container struct {
|
|||
Environment map[string]string `json:"environment,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
Privileged bool `json:"privileged"`
|
||||
Entrypoint string `json:"entrypoint"`
|
||||
}
|
||||
|
||||
type Workspace []WorkspaceLevel
|
||||
|
|
Loading…
Reference in New Issue