diff --git a/internal/config/config.go b/internal/config/config.go index 884ed37..5a3d7d6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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 { diff --git a/internal/runconfig/runconfig.go b/internal/runconfig/runconfig.go index 0cd0c4f..1fa7ea6 100644 --- a/internal/runconfig/runconfig.go +++ b/internal/runconfig/runconfig.go @@ -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{ diff --git a/internal/services/runservice/executor/executor.go b/internal/services/runservice/executor/executor.go index fb12f65..7a2341a 100644 --- a/internal/services/runservice/executor/executor.go +++ b/internal/services/runservice/executor/executor.go @@ -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, diff --git a/internal/services/runservice/types/types.go b/internal/services/runservice/types/types.go index 45c3a01..2a91745 100644 --- a/internal/services/runservice/types/types.go +++ b/internal/services/runservice/types/types.go @@ -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