From 6d0117615788b68b28a84cc55d0617f536afb3c6 Mon Sep 17 00:00:00 2001 From: Matthew Casperson Date: Fri, 26 Jul 2024 12:16:19 +1000 Subject: [PATCH] Allow dind to be enabled --- test/octopus_container_test_framework.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/octopus_container_test_framework.go b/test/octopus_container_test_framework.go index 138e43a..761a67d 100644 --- a/test/octopus_container_test_framework.go +++ b/test/octopus_container_test_framework.go @@ -190,6 +190,11 @@ func (o *OctopusContainerTest) setupOctopus(ctx context.Context, connString stri return nil, errors.New("the LICENSE environment variable must be set to a base 64 encoded Octopus license key") } + disableDind := os.Getenv("OCTODISABLEDIND") + if disableDind == "" { + disableDind = "Y" + } + req := testcontainers.ContainerRequest{ Name: "octopus-" + uuid.New().String(), Image: o.getOctopusImageUrl() + ":" + o.getOctopusVersion(), @@ -201,14 +206,14 @@ func (o *OctopusContainerTest) setupOctopus(ctx context.Context, connString stri "CONNSTRING": connString, "CREATE_DB": "Y", "ADMIN_API_KEY": ApiKey, - "DISABLE_DIND": "Y", + "DISABLE_DIND": disableDind, "ADMIN_USERNAME": "admin", "ADMIN_PASSWORD": "Password01!", "OCTOPUS_SERVER_BASE64_LICENSE": os.Getenv("LICENSE"), "LICENSE_BASE64": os.Getenv("LICENSE"), "ENABLE_USAGE": "N", }, - Privileged: false, + Privileged: disableDind != "Y", WaitingFor: wait.ForLog("Listening for HTTP requests on").WithStartupTimeout(30 * time.Minute), Networks: []string{ network,