From 00f0139ce9e1fd725e9a6a57a856b98e5279971b Mon Sep 17 00:00:00 2001 From: Sam Foo Date: Sun, 6 Aug 2023 18:34:56 -0700 Subject: [PATCH] Remove ContainerMaxLifetime --- pkg/runner/run_context.go | 6 ++---- pkg/runner/runner.go | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 19a0d49ca5f..e64dfa2f953 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -10,15 +10,13 @@ import ( "encoding/json" "errors" "fmt" + "github.com/opencontainers/selinux/go-selinux" "io" "os" "path/filepath" "regexp" "runtime" "strings" - "time" - - "github.com/opencontainers/selinux/go-selinux" "github.com/nektos/act/pkg/common" "github.com/nektos/act/pkg/container" @@ -325,7 +323,7 @@ func (rc *RunContext) startJobContainer() common.Executor { rc.JobContainer = container.NewContainer(&container.NewContainerInput{ Cmd: nil, - Entrypoint: []string{"/bin/sleep", fmt.Sprint(rc.Config.ContainerMaxLifetime.Round(time.Second).Seconds())}, + Entrypoint: []string{"/usr/bin/tail", "-f", "/dev/null"}, WorkingDir: ext.ToContainerPath(rc.Config.Workdir), Image: image, Username: username, diff --git a/pkg/runner/runner.go b/pkg/runner/runner.go index 2271ffce2f8..8de63a2d08f 100644 --- a/pkg/runner/runner.go +++ b/pkg/runner/runner.go @@ -4,11 +4,9 @@ import ( "context" "encoding/json" "fmt" + log "github.com/sirupsen/logrus" "os" "runtime" - "time" - - log "github.com/sirupsen/logrus" docker_container "github.com/docker/docker/api/types/container" "github.com/nektos/act/pkg/common" @@ -60,7 +58,6 @@ type Config struct { ReplaceGheActionWithGithubCom []string // Use actions from GitHub Enterprise instance to GitHub ReplaceGheActionTokenWithGithubCom string // Token of private action repo on GitHub. Matrix map[string]map[string]bool // Matrix config to run - ContainerMaxLifetime time.Duration // the max lifetime of job containers ContainerNetworkMode docker_container.NetworkMode // the network mode of job containers (the value of --network) ValidVolumes []string // only volumes (and bind mounts) in this slice can be mounted on the job container or service containers }