diff --git a/CHANGELOG.md b/CHANGELOG.md index 65b7552d..115aebd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ # ArangoDB Starter Changelog -## Changes from version 0.13.9 to master +## Changes from 0.13.10 to master +## Changes from version 0.13.9 to 0.13.10 + +- Implement that in Docker mode the ArangoDB license key is passed on + to sub-containers. + ## Changes from version 0.13.8 to 0.13.9 - Fix finding the storage engine if the master does not run a dbserver. diff --git a/docs/Manual/Deployment/ActiveFailover/UsingTheStarter.md b/docs/Manual/Deployment/ActiveFailover/UsingTheStarter.md index a62c259a..3e55f629 100644 --- a/docs/Manual/Deployment/ActiveFailover/UsingTheStarter.md +++ b/docs/Manual/Deployment/ActiveFailover/UsingTheStarter.md @@ -67,3 +67,20 @@ The _Starter_ will decide on which 2 machines to run a single server instance. To override this decision (only valid while bootstrapping), add a `--cluster.start-single=false` to the machine where the single server instance should _not_ be started. + +If you use an ArangoDB version of 3.4 or above and use the Enterprise +Edition Docker image, you have to set the license key in an environment +variable by adding this option to the above `docker` command: + +``` + -e ARANGO_LICENSE_KEY= +``` + +You can get a free evaluation license key by visiting + + https://www.arangodb.com/download-arangodb-enterprise/ + +Then replace `` above with the actual license key. The start +will then hand on the license key to the Docker containers it launches +for ArangoDB. + diff --git a/docs/Manual/Deployment/Cluster/UsingTheStarter.md b/docs/Manual/Deployment/Cluster/UsingTheStarter.md index 754b7838..0d6b8456 100644 --- a/docs/Manual/Deployment/Cluster/UsingTheStarter.md +++ b/docs/Manual/Deployment/Cluster/UsingTheStarter.md @@ -53,6 +53,22 @@ docker run -it --name=adb --rm -p 8528:8528 \ Run the above command on machine A, B & C. +If you use an ArangoDB version of 3.4 or above and use the Enterprise +Edition Docker image, you have to set the license key in an environment +variable by adding this option to the above `docker` command: + +``` + -e ARANGO_LICENSE_KEY= +``` + +You can get a free evaluation license key by visiting + + https://www.arangodb.com/download-arangodb-enterprise/ + +Then replace `` above with the actual license key. The start +will then hand on the license key to the Docker containers it launches +for ArangoDB. + Under the Hood -------------- The first `arangodb` you ran will become the _master_ of your _Starter_ diff --git a/docs/Manual/Deployment/SingleInstance/UsingTheStarter.md b/docs/Manual/Deployment/SingleInstance/UsingTheStarter.md index 59edd8db..3a61ebf9 100644 --- a/docs/Manual/Deployment/SingleInstance/UsingTheStarter.md +++ b/docs/Manual/Deployment/SingleInstance/UsingTheStarter.md @@ -30,3 +30,19 @@ docker run -it --name=adb --rm -p 8528:8528 \ --starter.address=$IP \ --starter.mode=single ``` + +If you use an ArangoDB version of 3.4 or above and use the Enterprise +Edition Docker image, you have to set the license key in an environment +variable by adding this option to the above `docker` command: + +``` + -e ARANGO_LICENSE_KEY= +``` + +You can get a free evaluation license key by visiting + + https://www.arangodb.com/download-arangodb-enterprise/ + +Then replace `` above with the actual license key. The start +will then hand on the license key to the Docker container it launches +for ArangoDB. diff --git a/service/runner_docker.go b/service/runner_docker.go index 9f339f55..32324d76 100644 --- a/service/runner_docker.go +++ b/service/runner_docker.go @@ -209,12 +209,18 @@ func (r *dockerRunner) startGC() { // Try to start a command with given arguments func (r *dockerRunner) start(image string, command string, args []string, volumes []Volume, ports []int, containerName, serverDir string, output io.Writer) (Process, error) { + env := make([]string, 0, 1) + licenseKey := os.Getenv("ARANGO_LICENSE_KEY") + if licenseKey != "" { + env = append(env, "ARANGO_LICENSE_KEY="+licenseKey) + } opts := docker.CreateContainerOptions{ Name: containerName, Config: &docker.Config{ Image: image, Entrypoint: []string{command}, Cmd: args, + Env: env, Tty: r.tty, AttachStdout: output != nil, AttachStderr: output != nil, diff --git a/test/docker_activefailover_default_test.go b/test/docker_activefailover_default_test.go index 971724e4..7c6cb056 100644 --- a/test/docker_activefailover_default_test.go +++ b/test/docker_activefailover_default_test.go @@ -72,6 +72,7 @@ func TestDockerActiveFailoverDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -90,6 +91,7 @@ func TestDockerActiveFailoverDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -109,6 +111,7 @@ func TestDockerActiveFailoverDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -179,6 +182,7 @@ func TestDockerActiveFailover2Instance(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -197,6 +201,7 @@ func TestDockerActiveFailover2Instance(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -216,6 +221,7 @@ func TestDockerActiveFailover2Instance(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_activefailover_local_test.go b/test/docker_activefailover_local_test.go index 565ab576..2b0607e7 100644 --- a/test/docker_activefailover_local_test.go +++ b/test/docker_activefailover_local_test.go @@ -64,6 +64,7 @@ func TestDockerActiveFailoverLocal(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -123,6 +124,7 @@ func TestDockerResilientActiveFailoverSecure(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_cluster_default_test.go b/test/docker_cluster_default_test.go index e40de07e..0fbcf9e8 100644 --- a/test/docker_cluster_default_test.go +++ b/test/docker_cluster_default_test.go @@ -70,6 +70,7 @@ func TestDockerClusterDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -87,6 +88,7 @@ func TestDockerClusterDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -105,6 +107,7 @@ func TestDockerClusterDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -172,6 +175,7 @@ func TestOldDockerClusterDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -189,6 +193,7 @@ func TestOldDockerClusterDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -207,6 +212,7 @@ func TestOldDockerClusterDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_cluster_diff_logdir_test.go b/test/docker_cluster_diff_logdir_test.go index 8e09f60b..9af9744e 100644 --- a/test/docker_cluster_diff_logdir_test.go +++ b/test/docker_cluster_diff_logdir_test.go @@ -80,6 +80,7 @@ func TestDockerClusterDifferentLogDir(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), fmt.Sprintf("-v %s:%s", masterLogDir, masterLogDir), @@ -100,6 +101,7 @@ func TestDockerClusterDifferentLogDir(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), fmt.Sprintf("-v %s:%s", slave1LogDir, slave1LogDir), @@ -121,6 +123,7 @@ func TestDockerClusterDifferentLogDir(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), fmt.Sprintf("-v %s:%s", slave2LogDir, slave2LogDir), @@ -211,6 +214,7 @@ func TestDockerClusterDifferentLogDirNoLog2File(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), fmt.Sprintf("-v %s:%s", masterLogDir, masterLogDir), @@ -232,6 +236,7 @@ func TestDockerClusterDifferentLogDirNoLog2File(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), fmt.Sprintf("-v %s:%s", slave1LogDir, slave1LogDir), @@ -254,6 +259,7 @@ func TestDockerClusterDifferentLogDirNoLog2File(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), fmt.Sprintf("-v %s:%s", slave2LogDir, slave2LogDir), diff --git a/test/docker_cluster_diff_ports_test.go b/test/docker_cluster_diff_ports_test.go index 975b8852..4723cc68 100644 --- a/test/docker_cluster_diff_ports_test.go +++ b/test/docker_cluster_diff_ports_test.go @@ -71,6 +71,7 @@ func TestDockerClusterDifferentPorts(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), "-p 6000:6000", fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -89,6 +90,7 @@ func TestDockerClusterDifferentPorts(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), "-p 7000:7000", fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -108,6 +110,7 @@ func TestDockerClusterDifferentPorts(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), "-p 8000:8000", fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_cluster_local_test.go b/test/docker_cluster_local_test.go index ca902b3f..3f2ff1d4 100644 --- a/test/docker_cluster_local_test.go +++ b/test/docker_cluster_local_test.go @@ -63,6 +63,7 @@ func TestDockerClusterLocal(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -121,6 +122,7 @@ func TestDockerClusterLocalAgencySize1(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -177,6 +179,7 @@ func TestOldDockerClusterLocal(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_cluster_multi_join_test.go b/test/docker_cluster_multi_join_test.go index a0974c2e..ea62468e 100644 --- a/test/docker_cluster_multi_join_test.go +++ b/test/docker_cluster_multi_join_test.go @@ -73,6 +73,7 @@ func TestDockerClusterMultipleJoins(t *testing.T) { "--label starter-test=true", "--name=" + cID1, //"--rm", + createLicenseKeyOption(), "-p 6000:6000", fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -92,6 +93,7 @@ func TestDockerClusterMultipleJoins(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), "-p 7000:7000", fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -111,6 +113,7 @@ func TestDockerClusterMultipleJoins(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), "-p 8000:8000", fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_cluster_recovery_test.go b/test/docker_cluster_recovery_test.go index b4de5b81..35e8c8be 100644 --- a/test/docker_cluster_recovery_test.go +++ b/test/docker_cluster_recovery_test.go @@ -72,6 +72,7 @@ func TestDockerClusterRecovery(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -90,6 +91,7 @@ func TestDockerClusterRecovery(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+100, basePort+100), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -109,6 +111,7 @@ func TestDockerClusterRecovery(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+200, basePort+200), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -182,6 +185,7 @@ func TestDockerClusterRecovery(t *testing.T) { "--label starter-test=true", "--name=" + recCID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+100, basePort+100), fmt.Sprintf("-v %s:/data", recVolID2), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_cluster_sync_test.go b/test/docker_cluster_sync_test.go index d11ea9c0..51428c81 100644 --- a/test/docker_cluster_sync_test.go +++ b/test/docker_cluster_sync_test.go @@ -68,6 +68,7 @@ func TestDockerClusterSync(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), fmt.Sprintf("-v %s:/certs", certs.Dir), @@ -93,6 +94,7 @@ func TestDockerClusterSync(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), fmt.Sprintf("-v %s:/certs", certs.Dir), @@ -119,6 +121,7 @@ func TestDockerClusterSync(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), fmt.Sprintf("-v %s:/certs", certs.Dir), diff --git a/test/docker_cluster_upgrade_test.go b/test/docker_cluster_upgrade_test.go index a5de0aa2..7aafead9 100644 --- a/test/docker_cluster_upgrade_test.go +++ b/test/docker_cluster_upgrade_test.go @@ -71,6 +71,7 @@ func TestDockerClusterUpgrade(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -88,6 +89,7 @@ func TestDockerClusterUpgrade(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -106,6 +108,7 @@ func TestDockerClusterUpgrade(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_database_version_test.go b/test/docker_database_version_test.go index 197f7d39..5648c11c 100644 --- a/test/docker_database_version_test.go +++ b/test/docker_database_version_test.go @@ -65,6 +65,7 @@ func TestDockerDatabaseVersion(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_resilientsingle_default_test.go b/test/docker_resilientsingle_default_test.go index ef1a948c..b347ebf0 100644 --- a/test/docker_resilientsingle_default_test.go +++ b/test/docker_resilientsingle_default_test.go @@ -72,6 +72,7 @@ func TestDockerResilientSingleDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -90,6 +91,7 @@ func TestDockerResilientSingleDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -109,6 +111,7 @@ func TestDockerResilientSingleDefault(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -179,6 +182,7 @@ func TestDockerResilientSingle2Instance(t *testing.T) { "--label starter-test=true", "--name=" + cID1, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID1), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -197,6 +201,7 @@ func TestDockerResilientSingle2Instance(t *testing.T) { "--label starter-test=true", "--name=" + cID2, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID2), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -216,6 +221,7 @@ func TestDockerResilientSingle2Instance(t *testing.T) { "--label starter-test=true", "--name=" + cID3, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort), fmt.Sprintf("-v %s:/data", volID3), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_resilientsingle_local_test.go b/test/docker_resilientsingle_local_test.go index c26e9fa7..351aff95 100644 --- a/test/docker_resilientsingle_local_test.go +++ b/test/docker_resilientsingle_local_test.go @@ -64,6 +64,7 @@ func TestDockerResilientSingleLocal(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -123,6 +124,7 @@ func TestDockerResilientSingleLocalSecure(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/docker_single_test.go b/test/docker_single_test.go index 8bdae1c8..5e761cf2 100644 --- a/test/docker_single_test.go +++ b/test/docker_single_test.go @@ -63,6 +63,7 @@ func TestDockerSingle(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -120,6 +121,7 @@ func TestDockerSingleAutoKeyFile(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -176,6 +178,7 @@ func TestDockerSingleAutoContainerName(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -232,6 +235,7 @@ func TestDockerSingleAutoRocksdb(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", @@ -287,6 +291,7 @@ func TestOldDockerSingleAutoKeyFile(t *testing.T) { "--label starter-test=true", "--name=" + cID, "--rm", + createLicenseKeyOption(), fmt.Sprintf("-p %d:%d", basePort, basePort), fmt.Sprintf("-v %s:/data", volID), "-v /var/run/docker.sock:/var/run/docker.sock", diff --git a/test/util.go b/test/util.go index 87450fcb..bbe994ea 100644 --- a/test/util.go +++ b/test/util.go @@ -285,3 +285,10 @@ func createEnvironmentStarterOptions(skipDockerImage ...bool) string { } return strings.Join(result, " ") } + +func createLicenseKeyOption() string { + if license := os.Getenv("ARANGO_LICENSE_KEY"); license != "" { + return "-e ARANGO_LICENSE_KEY=" + license + } + return "" +}