Skip to content

Commit 0d91769

Browse files
authored
fix: disable Ryuk reaper when cleanup.on is never (#147)
1 parent 530f997 commit 0d91769

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/components/setup/compose.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"gopkg.in/yaml.v2"
3333

3434
"github.com/apache/skywalking-infra-e2e/internal/config"
35+
"github.com/apache/skywalking-infra-e2e/internal/constant"
3536
"github.com/apache/skywalking-infra-e2e/internal/logger"
3637
"github.com/apache/skywalking-infra-e2e/internal/util"
3738
)
@@ -55,6 +56,13 @@ func ComposeSetup(e2eConfig *config.E2EConfig) error {
5556
util.ExportEnvVars(profilePath)
5657
}
5758

59+
// Disable Ryuk reaper when cleanup.on is "never" so containers survive process exit.
60+
if e2eConfig.Cleanup.On == constant.CleanUpNever {
61+
if err := os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true"); err != nil {
62+
return fmt.Errorf("failed to disable Ryuk reaper: %v", err)
63+
}
64+
}
65+
5866
// create compose stack
5967
identifier := util.GetIdentity()
6068
stack, err := compose.NewDockerComposeWith(

0 commit comments

Comments
 (0)