From 6defce06fcfd5133ea74219752bf0af414f42279 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Tue, 12 Mar 2024 10:09:01 +1100 Subject: [PATCH] chore: support newer compose-go library with lagoon workarounds --- go.mod | 12 +- go.sum | 59 ++------- internal/generator/services.go | 2 +- internal/generator/services_test.go | 2 +- internal/lagoon/compose.go | 16 ++- internal/lagoon/compose_test.go | 72 +++++++---- .../complex/docker-compose.multi-db.yml | 6 +- legacy/build-deploy-docker-compose.sh | 2 + .../docker-compose/test1/docker-compose.yml | 6 +- .../docker-compose/test12/docker-compose.yml | 113 ++++++++++++++++++ .../docker-compose/test13/docker-compose.yml | 113 ++++++++++++++++++ .../docker-compose/test5/docker-compose.yml | 6 +- 12 files changed, 315 insertions(+), 94 deletions(-) create mode 100644 test-resources/docker-compose/test12/docker-compose.yml create mode 100644 test-resources/docker-compose/test13/docker-compose.yml diff --git a/go.mod b/go.mod index 451f6c8e..c9c07be0 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,12 @@ require ( dario.cat/mergo v1.0.0 github.com/PaesslerAG/gval v1.2.2 github.com/amazeeio/dbaas-operator v0.3.0 - github.com/compose-spec/compose-go v1.2.7 + github.com/compose-spec/compose-go/v2 v2.0.0-rc.8 github.com/cxmcc/unixsums v0.0.0-20131125091133-89564297d82f github.com/google/go-cmp v0.5.9 github.com/hashicorp/go-retryablehttp v0.7.5 github.com/k8up-io/k8up/v2 v2.7.2 + github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/uselagoon/machinery v0.0.12 github.com/vshn/k8up v1.99.99 @@ -24,7 +25,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e // indirect + github.com/distribution/reference v0.5.0 // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect @@ -45,7 +46,9 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/spdystream v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -53,12 +56,11 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/shopspring/decimal v1.3.1 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sync v0.5.0 // indirect @@ -79,6 +81,6 @@ require ( replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16 -replace github.com/compose-spec/compose-go v1.2.7 => github.com/shreddedbacon/compose-go v0.0.0-20220616064547-4e908a2865c1 +replace github.com/compose-spec/compose-go/v2 v2.0.0-rc.8 => github.com/shreddedbacon/compose-go/v2 v2.0.0-20240312080248-f885cd14d500 // replace github.com/compose-spec/compose-go v1.2.7 => ../../compose-spec/compose-go diff --git a/go.sum b/go.sum index 05cba456..cc892d7f 100644 --- a/go.sum +++ b/go.sum @@ -25,9 +25,7 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= @@ -64,7 +62,6 @@ github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -85,7 +82,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.34.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -94,16 +90,10 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bombsimon/wsl v1.2.5/go.mod h1:43lEF/i0kpXbLCeDXL9LMT8c92HyBywXb0AsgMHYngM= -github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -142,23 +132,17 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e h1:n81KvOMrLZa+VWHwST7dun9f0G98X3zREHS1ztYzZKU= -github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e/go.mod h1:xpWTC2KnJMiDLkoawhsPQcXjvwATEBcbq0xevG2YR9M= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -184,7 +168,6 @@ github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firepear/qsplit/v2 v2.5.0/go.mod h1:Q65ZpyUdvAUkXISeeNtA3DPlDwEn9mHU/kzTtPUxmKQ= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -373,7 +356,6 @@ github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlS github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= @@ -416,7 +398,6 @@ github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3i github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -481,7 +462,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= @@ -548,7 +528,6 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -573,6 +552,7 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/minio/minio-go v6.0.14+incompatible/go.mod h1:7guKYtitv8dktvNUGrhzmNlA5wrAABTQXCoesZdFQO8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -587,8 +567,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= @@ -613,7 +593,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -645,7 +624,6 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulmach/orb v0.1.3/go.mod h1:VFlX/8C+IQ1p6FTRRKzKoOPJnvEtA5G0Veuqwbu//Vk= @@ -669,7 +647,6 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= @@ -684,7 +661,6 @@ github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7q github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= @@ -693,7 +669,6 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= @@ -717,7 +692,6 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/securego/gosec v0.0.0-20191002120514-e680875ea14d/go.mod h1:w5+eXa0mYznDkHaMCXA4XYffjlH+cy1oyKbfzJXa2Do= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -726,8 +700,8 @@ github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lz github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shreddedbacon/compose-go v0.0.0-20220616064547-4e908a2865c1 h1:/OYATO27ywKZ506enKV8Fd8gjLYFU9uQqCMmcVOUpW0= -github.com/shreddedbacon/compose-go v0.0.0-20220616064547-4e908a2865c1/go.mod h1:Jl9L8zJrt4aGY1XAz03DvHAu8V3/f00TK+uJL4BayDU= +github.com/shreddedbacon/compose-go/v2 v2.0.0-20240312080248-f885cd14d500 h1:cHBIE5doj7WaY6CgsQNruxy6FryG8E8DO/GAJjY+JaI= +github.com/shreddedbacon/compose-go/v2 v2.0.0-20240312080248-f885cd14d500/go.mod h1:bEPizBkIojlQ20pi2vNluBa58tevvj0Y18oUSHPyfdc= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -822,9 +796,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yujunz/go-getter v1.4.1-lite/go.mod h1:sbmqxXjyLunH1PkF3n7zSlnVeMvmYUuIl9ZVs/7NyCc= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -877,7 +848,6 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -895,8 +865,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1010,7 +980,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1148,8 +1117,8 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= -golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1160,7 +1129,6 @@ gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuB gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1179,7 +1147,6 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1202,7 +1169,6 @@ google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1230,7 +1196,6 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1271,8 +1236,8 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= -gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/generator/services.go b/internal/generator/services.go index e382d4ac..745c9732 100644 --- a/internal/generator/services.go +++ b/internal/generator/services.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - composetypes "github.com/compose-spec/compose-go/types" + composetypes "github.com/compose-spec/compose-go/v2/types" "github.com/uselagoon/build-deploy-tool/internal/helpers" "github.com/uselagoon/build-deploy-tool/internal/lagoon" ) diff --git a/internal/generator/services_test.go b/internal/generator/services_test.go index 40f28f0b..3a456861 100644 --- a/internal/generator/services_test.go +++ b/internal/generator/services_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - composetypes "github.com/compose-spec/compose-go/types" + composetypes "github.com/compose-spec/compose-go/v2/types" "github.com/uselagoon/build-deploy-tool/internal/dbaasclient" "github.com/uselagoon/build-deploy-tool/internal/helpers" "github.com/uselagoon/build-deploy-tool/internal/lagoon" diff --git a/internal/lagoon/compose.go b/internal/lagoon/compose.go index 072f5252..6a1c5b56 100644 --- a/internal/lagoon/compose.go +++ b/internal/lagoon/compose.go @@ -1,13 +1,16 @@ package lagoon import ( + "context" "errors" "fmt" + "io" "os" - "github.com/compose-spec/compose-go/cli" - "github.com/compose-spec/compose-go/loader" - composetypes "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/cli" + "github.com/compose-spec/compose-go/v2/loader" + composetypes "github.com/compose-spec/compose-go/v2/types" + "github.com/sirupsen/logrus" goyaml "gopkg.in/yaml.v2" goyamlv3 "gopkg.in/yaml.v3" utilvalidation "k8s.io/apimachinery/pkg/util/validation" @@ -20,6 +23,8 @@ type OriginalServiceOrder struct { // UnmarshaDockerComposeYAML unmarshal the lagoon.yml file into a YAML and map for consumption. func UnmarshaDockerComposeYAML(file string, ignoreErrors, ignoreMissingEnvFiles bool, envvars map[string]string) (*composetypes.Project, []OriginalServiceOrder, error) { + // disable logging output for now, maybe capture this in a buffer for later analysis + logrus.SetOutput(io.Discard) options, err := cli.NewProjectOptions([]string{file}, cli.WithResolvedPaths(false), cli.WithLoadOptions( @@ -31,8 +36,11 @@ func UnmarshaDockerComposeYAML(file string, ignoreErrors, ignoreMissingEnvFiles }, ), ) + if err != nil { + return nil, nil, err + } options.Environment = envvars - l, err := cli.ProjectFromOptions(options) + l, err := cli.ProjectFromOptions(context.Background(), options) if err != nil { return nil, nil, err } diff --git a/internal/lagoon/compose_test.go b/internal/lagoon/compose_test.go index 636134f9..2af70e4d 100644 --- a/internal/lagoon/compose_test.go +++ b/internal/lagoon/compose_test.go @@ -27,7 +27,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { args: args{ file: "../../test-resources/docker-compose/test1/docker-compose.yml", }, - want: `{"name":"test1","services":{"cli":{"build":{"context":".","dockerfile":"lagoon/cli.dockerfile"},"environment":{"LAGOON_ROUTE":"http://drupal9-example-advanced.docker.amazee.io"},"image":"drupal9-example-advanced-cli","labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent","lando.type":"php-cli-drupal"},"networks":{"default":null},"user":"root","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"files","target":"/app/web/sites/default/files","volume":{}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"environment":{"LAGOON_ROUTE":"http://drupal9-example-advanced.docker.amazee.io"},"image":"uselagoon/mariadb-10.5-drupal:latest","labels":{"lagoon.type":"mariadb","lando.type":"mariadb-drupal"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}],"user":"1000"},"nginx":{"build":{"context":".","dockerfile":"lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"drupal9-example-advanced-cli"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"LAGOON_LOCALDEV_URL":"http://drupal9-example-advanced.docker.amazee.io","LAGOON_ROUTE":"http://drupal9-example-advanced.docker.amazee.io"},"labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent","lando.type":"nginx-drupal"},"networks":{"amazeeio-network":null,"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"files","target":"/app/web/sites/default/files","volume":{}}]},"php":{"build":{"context":".","dockerfile":"lagoon/php.dockerfile","args":{"CLI_IMAGE":"drupal9-example-advanced-cli"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"LAGOON_ROUTE":"http://drupal9-example-advanced.docker.amazee.io"},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent","lando.type":"php-fpm"},"networks":{"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"files","target":"/app/web/sites/default/files","volume":{}}]},"redis":{"environment":{"LAGOON_ROUTE":"http://drupal9-example-advanced.docker.amazee.io"},"image":"uselagoon/redis-5:latest","labels":{"lagoon.type":"redis","lando.type":"redis"},"networks":{"default":null},"ports":[{"mode":"ingress","target":6379,"protocol":"tcp"}],"user":"1000"},"solr":{"environment":{"LAGOON_ROUTE":"http://drupal9-example-advanced.docker.amazee.io"},"image":"uselagoon/solr-7.7-drupal:latest","labels":{"lagoon.type":"solr","lando.type":"solr-drupal"},"networks":{"default":null},"ports":[{"mode":"ingress","target":8983,"protocol":"tcp"}]}},"networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test1_default","ipam":{},"external":false}},"volumes":{"files":{"name":"test1_files","external":false}}}`, + want: `{"name":"test1","networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test1_default","ipam":{}}},"services":{"cli":{"build":{"context":".","dockerfile":"lagoon/cli.dockerfile"},"command":null,"entrypoint":null,"environment":{"LAGOON_ROUTE":"http://test1.docker.amazee.io"},"image":"test1-cli","labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent","lando.type":"php-cli-drupal"},"networks":{"default":null},"user":"root","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"files","target":"/app/web/sites/default/files","volume":{}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"command":null,"entrypoint":null,"environment":{"LAGOON_ROUTE":"http://test1.docker.amazee.io"},"image":"uselagoon/mariadb-10.5-drupal:latest","labels":{"lagoon.type":"mariadb","lando.type":"mariadb-drupal"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}],"user":"1000"},"nginx":{"build":{"context":".","dockerfile":"lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"test1-cli"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"LAGOON_LOCALDEV_URL":"http://test1.docker.amazee.io","LAGOON_ROUTE":"http://test1.docker.amazee.io"},"labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent","lando.type":"nginx-drupal"},"networks":{"amazeeio-network":null,"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"files","target":"/app/web/sites/default/files","volume":{}}]},"php":{"build":{"context":".","dockerfile":"lagoon/php.dockerfile","args":{"CLI_IMAGE":"test1-cli"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"LAGOON_ROUTE":"http://test1.docker.amazee.io"},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent","lando.type":"php-fpm"},"networks":{"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"files","target":"/app/web/sites/default/files","volume":{}}]},"redis":{"command":null,"entrypoint":null,"environment":{"LAGOON_ROUTE":"http://test1.docker.amazee.io"},"image":"uselagoon/redis-5:latest","labels":{"lagoon.type":"redis","lando.type":"redis"},"networks":{"default":null},"ports":[{"mode":"ingress","target":6379,"protocol":"tcp"}],"user":"1000"},"solr":{"command":null,"entrypoint":null,"environment":{"LAGOON_ROUTE":"http://test1.docker.amazee.io"},"image":"uselagoon/solr-7.7-drupal:latest","labels":{"lagoon.type":"solr","lando.type":"solr-drupal"},"networks":{"default":null},"ports":[{"mode":"ingress","target":8983,"protocol":"tcp"}]}},"volumes":{"files":{"name":"test1_files"}},"x-environment":{"LAGOON_ROUTE":"http://test1.docker.amazee.io"},"x-user":{"user":"1000"},"x-volumes":{"volumes":[".:/app:delegated","files:/app/web/sites/default/files"]}}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "cli"}, {Index: 1, Name: "nginx"}, @@ -42,7 +42,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { args: args{ file: "../../test-resources/docker-compose/test2/docker-compose.yml", }, - want: `{"name":"test2","services":{"node":{"build":{"context":".","dockerfile":"node.dockerfile"},"environment":{"LAGOON_LOCALDEV_HTTP_PORT":"3000","LAGOON_ROUTE":"http://node.docker.amazee.io"},"labels":{"lagoon.type":"node"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]}},"networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test2_default","ipam":{},"external":false}}}`, + want: `{"name":"test2","networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test2_default","ipam":{}}},"services":{"node":{"build":{"context":".","dockerfile":"node.dockerfile"},"command":null,"entrypoint":null,"environment":{"LAGOON_LOCALDEV_HTTP_PORT":"3000","LAGOON_ROUTE":"http://node.docker.amazee.io"},"labels":{"lagoon.type":"node"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]}}}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "node"}, }, @@ -52,7 +52,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { args: args{ file: "../../test-resources/docker-compose/test3/docker-compose.yml", }, - want: `{"name":"test3","services":{"cli":{"build":{"context":".","dockerfile":".lagoon/cli.dockerfile","args":{"DOCKER_CLI_IMAGE_URI":"","ENVIRONMENT_TYPE_ID":""}},"container_name":"_cli","environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"user":"root","volumes":[{"type":"bind","source":"./.lagoon/scripts/bash_prompts.rc","target":"/home/.bashrc","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/scripts/color_grid.sh","target":"/home/color_grid.sh","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"container_name":"_db","environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"image":"amazeeio/mariadb-drupal","labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}],"volumes":[{"type":"volume","source":"mysql","target":"/var/lib/mysql","volume":{}}]},"nginx":{"build":{"context":".","dockerfile":".lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"","DOCKER_NGINX_IMAGE_URI":"","LAGOON_GIT_BRANCH":""}},"container_name":"_nginx","depends_on":{"cli":{"condition":"service_started"}},"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_LOCALDEV_URL":"http://","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":"./.lagoon/nginx/nginx-http.conf","target":"/etc/nginx/conf.d/000-nginx-http.conf","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/nginx/app.conf","target":"/etc/nginx/conf.d/app.conf","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".lagoon/php.dockerfile","args":{"CLI_IMAGE":"","DOCKER_PHP_IMAGE_URI":""}},"container_name":"_php","depends_on":{"cli":{"condition":"service_started"}},"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.deployment.servicetype":"php","lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files","lagoon.type":"nginx-php-persistent"},"networks":{"default":null}}},"networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test3_default","ipam":{},"external":false}},"volumes":{"app":{"name":"test3_app","external":false},"mysql":{"name":"test3_mysql","external":false},"solr7":{"name":"test3_solr7","external":false}}}`, + want: `{"name":"test3","networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test3_default","ipam":{}}},"services":{"cli":{"build":{"context":".","dockerfile":".lagoon/cli.dockerfile","args":{"DOCKER_CLI_IMAGE_URI":"","ENVIRONMENT_TYPE_ID":""}},"command":null,"container_name":"_cli","entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"user":"root","volumes":[{"type":"bind","source":"./.lagoon/scripts/bash_prompts.rc","target":"/home/.bashrc","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/scripts/color_grid.sh","target":"/home/color_grid.sh","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"command":null,"container_name":"_db","entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"image":"amazeeio/mariadb-drupal","labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}],"volumes":[{"type":"volume","source":"mysql","target":"/var/lib/mysql","volume":{}}]},"nginx":{"build":{"context":".","dockerfile":".lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"","DOCKER_NGINX_IMAGE_URI":"","LAGOON_GIT_BRANCH":""}},"command":null,"container_name":"_nginx","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_LOCALDEV_URL":"http://","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":"./.lagoon/nginx/nginx-http.conf","target":"/etc/nginx/conf.d/000-nginx-http.conf","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/nginx/app.conf","target":"/etc/nginx/conf.d/app.conf","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".lagoon/php.dockerfile","args":{"CLI_IMAGE":"","DOCKER_PHP_IMAGE_URI":""}},"command":null,"container_name":"_php","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.deployment.servicetype":"php","lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files","lagoon.type":"nginx-php-persistent"},"networks":{"default":null}}},"volumes":{"app":{"name":"test3_app"},"mysql":{"name":"test3_mysql"},"solr7":{"name":"test3_solr7"}},"x-environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"x-lagoon-project":"","x-site-branch":"","x-user":{"user":""}}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "cli"}, {Index: 1, Name: "nginx"}, @@ -65,7 +65,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { args: args{ file: "../../test-resources/docker-compose/test4/docker-compose.yml", }, - want: `{"name":"test4","services":{"chrome":{"depends_on":{"cli":{"condition":"service_started"}},"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"seleniarm/standalone-chromium:101.0","labels":{"lagoon.type":"none"},"networks":{"default":null},"shm_size":"1073741824","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}]},"clamav":{"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"clamav/example-clamav:4.x","labels":{"lagoon.type":"none"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3310,"protocol":"tcp"}]},"cli":{"build":{"context":".","dockerfile":".docker/Dockerfile.cli","args":{"COMPOSER":"composer.json","EXAMPLE_IMAGE_VERSION":"4.x"}},"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"mysite","labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx-php","lagoon.persistent.size":"50Gi","lagoon.type":"cli-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"elasticsearch":{"build":{"context":".","dockerfile":".docker/Dockerfile.elasticsearch","args":{"ES_TPL":"elasticsearch.yml"}},"labels":{"lagoon.type":"none"},"networks":{"default":null}},"mariadb":{"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"uselagoon/mariadb-10.4-drupal:latest","labels":{"lagoon.type":"mariadb-shared"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":".docker/Dockerfile.nginx-drupal","args":{"CLI_IMAGE":"mysite","EXAMPLE_IMAGE_VERSION":"4.x"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"expose":["8080"],"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.size":"50Gi","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".docker/Dockerfile.php","args":{"CLI_IMAGE":"mysite","EXAMPLE_IMAGE_VERSION":"4.x"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.size":"50Gi","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}]},"redis":{"image":"uselagoon/redis-5:latest","labels":{"lagoon.type":"redis"},"networks":{"default":null}}},"networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test4_default","ipam":{},"external":false}},"volumes":{"app":{"name":"test4_app","external":false},"files":{"name":"test4_files","external":false}}}`, + want: `{"name":"test4","networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test4_default","ipam":{}}},"services":{"chrome":{"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"seleniarm/standalone-chromium:101.0","labels":{"lagoon.type":"none"},"networks":{"default":null},"shm_size":"1073741824","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}]},"clamav":{"command":null,"entrypoint":null,"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"clamav/example-clamav:4.x","labels":{"lagoon.type":"none"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3310,"protocol":"tcp"}]},"cli":{"build":{"context":".","dockerfile":".docker/Dockerfile.cli","args":{"COMPOSER":"composer.json","EXAMPLE_IMAGE_VERSION":"4.x"}},"command":null,"entrypoint":null,"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"mysite","labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx-php","lagoon.persistent.size":"50Gi","lagoon.type":"cli-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"elasticsearch":{"build":{"context":".","dockerfile":".docker/Dockerfile.elasticsearch","args":{"ES_TPL":"elasticsearch.yml"}},"command":null,"entrypoint":null,"labels":{"lagoon.type":"none"},"networks":{"default":null}},"mariadb":{"command":null,"entrypoint":null,"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"image":"uselagoon/mariadb-10.4-drupal:latest","labels":{"lagoon.type":"mariadb-shared"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":".docker/Dockerfile.nginx-drupal","args":{"CLI_IMAGE":"mysite","EXAMPLE_IMAGE_VERSION":"4.x"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"expose":["8080"],"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.size":"50Gi","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".docker/Dockerfile.php","args":{"CLI_IMAGE":"mysite","EXAMPLE_IMAGE_VERSION":"4.x"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.size":"50Gi","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"bind","source":"./docroot/sites/default/files","target":"/app/docroot/sites/default/files","bind":{"create_host_path":true}}]},"redis":{"command":null,"entrypoint":null,"image":"uselagoon/redis-5:latest","labels":{"lagoon.type":"redis"},"networks":{"default":null}}},"volumes":{"app":{"name":"test4_app"},"files":{"name":"test4_files"}},"x-environment":{"CKEDITOR_SCAYT_CUSTOMERID":"","CKEDITOR_SCAYT_SLANG":"","DB_ALIAS":"example.prod-left","DRUPAL_HASH_SALT":"fakehashsaltfakehashsaltfakehashsalt","DRUPAL_REFRESH_SEARCHAPI":"","EXAMPLE_IMAGE_VERSION":"latest","EXAMPLE_INGRESS_ENABLED":"","EXAMPLE_INGRESS_HEADER":"","EXAMPLE_INGRESS_PSK":"","EXAMPLE_KEY":"","GITHUB_TOKEN":"","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"http://mysite.docker.amazee.io","LAGOON_PROJECT":"mysite","LAGOON_ROUTE":"http://mysite.docker.amazee.io","PHP_MEMORY_LIMIT":"1024M","REDIS_CACHE_PREFIX":"tide_"},"x-example-image-version":"4.x","x-project":"mysite","x-volumes":{"volumes":[".:/app:delegated","./docroot/sites/default/files:/app/docroot/sites/default/files:delegated"]}}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "cli"}, {Index: 1, Name: "nginx"}, @@ -82,7 +82,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { args: args{ file: "../../test-resources/docker-compose/test5/docker-compose.yml", }, - want: `{"name":"test5","services":{"chrome":{"depends_on":{"cli":{"condition":"service_started"}},"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"image":"selenium/standalone-chrome:3.141.59-oxygen","labels":{"lagoon.type":"none"},"networks":{"default":null},"shm_size":"1073741824","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"cli":{"build":{"context":".","dockerfile":".docker/Dockerfile.cli"},"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"image":"example-project","labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx-php","lagoon.type":"cli-persistent"},"networks":{"default":null},"ports":[{"mode":"ingress","target":35729,"protocol":"tcp"}],"user":"root","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"build":{"context":".","dockerfile":".docker/Dockerfile.mariadb","args":{"IMAGE":"amazeeio/mariadb-drupal:21.7.0"}},"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":".docker/Dockerfile.nginx-drupal","args":{"CLI_IMAGE":"example-project"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.class":"slow","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".docker/Dockerfile.php","args":{"CLI_IMAGE":"example-project"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.class":"slow","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"redis":{"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"image":"amazeeio/redis:6-21.11.0","labels":{"lagoon.type":"redis"},"networks":{"default":null}},"wait_dependencies":{"command":["mariadb:3306"],"depends_on":{"cli":{"condition":"service_started"},"mariadb":{"condition":"service_started"}},"image":"dadarek/wait-for-dependencies","labels":{"lagoon.type":"none"},"networks":{"default":null}}},"networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test5_default","ipam":{},"external":false}},"volumes":{"app":{"name":"test5_app","external":false}}}`, + want: `{"name":"test5","networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test5_default","ipam":{}}},"services":{"chrome":{"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"image":"selenium/standalone-chrome:3.141.59-oxygen","labels":{"lagoon.type":"none"},"networks":{"default":null},"shm_size":"1073741824","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"cli":{"build":{"context":".","dockerfile":".docker/Dockerfile.cli"},"command":null,"entrypoint":null,"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"image":"example-project","labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx-php","lagoon.type":"cli-persistent"},"networks":{"default":null},"ports":[{"mode":"ingress","target":35729,"protocol":"tcp"}],"user":"root","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"build":{"context":".","dockerfile":".docker/Dockerfile.mariadb","args":{"IMAGE":"amazeeio/mariadb-drupal:21.7.0"}},"command":null,"entrypoint":null,"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":".docker/Dockerfile.nginx-drupal","args":{"CLI_IMAGE":"example-project"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.class":"slow","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".docker/Dockerfile.php","args":{"CLI_IMAGE":"example-project"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx-php","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.class":"slow","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"user":"1000","volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"redis":{"command":null,"entrypoint":null,"environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":"-1","PHP_MAX_INPUT_VARS":"4000","PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"image":"amazeeio/redis:6-21.11.0","labels":{"lagoon.type":"redis"},"networks":{"default":null}},"wait_dependencies":{"command":["mariadb:3306"],"depends_on":{"cli":{"condition":"service_started","required":true},"mariadb":{"condition":"service_started","required":true}},"entrypoint":null,"image":"dadarek/wait-for-dependencies","labels":{"lagoon.type":"none"},"networks":{"default":null}}},"volumes":{"app":{"name":"test5_app"}},"x-environment":{"CI":"","DOCKERHOST":"host.docker.internal","LAGOON_ENVIRONMENT_TYPE":"local","LAGOON_LOCALDEV_URL":"example-project.docker.amazee.io","LAGOON_PROJECT":"example-project","LAGOON_ROUTE":"example-project.docker.amazee.io","PHP_APC_SHM_SIZE":"256M","PHP_MAX_EXECUTION_TIME":-1,"PHP_MAX_INPUT_VARS":4000,"PHP_MEMORY_LIMIT":"2G","XDEBUG_ENABLE":""},"x-project":"example-project","x-user":{"user":"1000"},"x-volumes":{"volumes":[".:/app:delegated"]}}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "cli"}, {Index: 1, Name: "nginx"}, @@ -98,7 +98,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { args: args{ file: "../../test-resources/docker-compose/test6/docker-compose.yml", }, - want: `{"name":"test6","services":{"chrome":{"depends_on":{"test":{"condition":"service_started"}},"image":"selenium/standalone-chrome","labels":{"lagoon.type":"none"},"networks":{"default":null},"shm_size":"1073741824","volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]},"cli":{"build":{"context":".","dockerfile":".docker/Dockerfile.cli","args":{"EXAMPLE_IMAGE_VERSION":"9.x-latest","LAGOON_SAFE_PROJECT":"ca-learning2"}},"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"image":"ca-learning2","labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"image":"example/mariadb-drupal:9.x-latest","labels":{"lagoon.image":"example/mariadb-drupal:9.x-latest","lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":".docker/Dockerfile.nginx-drupal","args":{"CLI_IMAGE":"ca-learning2","EXAMPLE_IMAGE_VERSION":"9.x-latest"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_LOCALDEV_URL":"http://ca-learning2.docker.amazee.io","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".docker/Dockerfile.php","args":{"CLI_IMAGE":"ca-learning2","EXAMPLE_IMAGE_VERSION":"9.x-latest"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]},"test":{"build":{"context":".","dockerfile":".docker/Dockerfile.test","args":{"CLI_IMAGE":"ca-learning2","EXAMPLE_IMAGE_VERSION":"9.x-latest","SITE_AUDIT_VERSION":"7.x-3.x"}},"depends_on":{"cli":{"condition":"service_started"}},"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"labels":{"lagoon.type":"none"},"networks":{"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]}},"networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test6_default","ipam":{},"external":false}}}`, + want: `{"name":"test6","networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test6_default","ipam":{}}},"services":{"chrome":{"command":null,"depends_on":{"test":{"condition":"service_started","required":true}},"entrypoint":null,"image":"selenium/standalone-chrome","labels":{"lagoon.type":"none"},"networks":{"default":null},"shm_size":"1073741824","volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]},"cli":{"build":{"context":".","dockerfile":".docker/Dockerfile.cli","args":{"EXAMPLE_IMAGE_VERSION":"9.x-latest","LAGOON_SAFE_PROJECT":"ca-learning2"}},"command":null,"entrypoint":null,"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"image":"ca-learning2","labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"command":null,"entrypoint":null,"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"image":"example/mariadb-drupal:9.x-latest","labels":{"lagoon.image":"example/mariadb-drupal:9.x-latest","lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":".docker/Dockerfile.nginx-drupal","args":{"CLI_IMAGE":"ca-learning2","EXAMPLE_IMAGE_VERSION":"9.x-latest"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_LOCALDEV_URL":"http://ca-learning2.docker.amazee.io","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"labels":{"lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".docker/Dockerfile.php","args":{"CLI_IMAGE":"ca-learning2","EXAMPLE_IMAGE_VERSION":"9.x-latest"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/web/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]},"test":{"build":{"context":".","dockerfile":".docker/Dockerfile.test","args":{"CLI_IMAGE":"ca-learning2","EXAMPLE_IMAGE_VERSION":"9.x-latest","SITE_AUDIT_VERSION":"7.x-3.x"}},"command":null,"depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"labels":{"lagoon.type":"none"},"networks":{"default":null},"volumes":[{"type":"bind","source":"./themes","target":"/app/web/themes/custom","bind":{"create_host_path":true}},{"type":"bind","source":"./files","target":"/app/web/sites/default/files","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/features","target":"/app/tests/behat/features","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/behat/screenshots","target":"/app/tests/behat/screenshots","bind":{"create_host_path":true}},{"type":"bind","source":"./tests/phpunit/tests","target":"/app/tests/phpunit/tests","bind":{"create_host_path":true}},{"type":"bind","source":"./config","target":"/app/config","bind":{"create_host_path":true}}]}},"x-environment":{"DEV_MODE":"false","DOCKERHOST":"host.docker.internal","DRUPAL_SHIELD_PASS":"","DRUPAL_SHIELD_USER":"","EXAMPLE_DEPLOY_WORKFLOW_CONFIG":"import","EXAMPLE_IMAGE_VERSION":"9.x-latest","EXAMPLE_PREPARE_XML_SCRIPT":"/app/vendor/bin/example-prepare-xml","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"ca-learning2","LAGOON_ROUTE":"http://ca-learning2.docker.amazee.io","STAGE_FILE_PROXY_URL":"","XDEBUG_ENABLE":"","X_FRAME_OPTIONS":"SameOrigin"},"x-example-image-version":"9.x-latest","x-lagoon-local-dev-url":"http://ca-learning2.docker.amazee.io","x-lagoon-project":"ca-learning2","x-volumes":{"volumes":["./themes:/app/web/themes/custom:delegated","./files:/app/web/sites/default/files:delegated","./tests/behat/features:/app/tests/behat/features:delegated","./tests/behat/screenshots:/app/tests/behat/screenshots:delegated","./tests/phpunit/tests:/app/tests/phpunit/tests:delegated","./config:/app/config"]},"x-volumes-paas":{"volumes":[".:/app:delegated"]}}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "cli"}, {Index: 1, Name: "test"}, @@ -114,7 +114,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { file: "../../test-resources/docker-compose/test7/docker-compose.yml", ignoreNonStringKeyErrors: true, }, - want: `{"name":"test7","services":{"cli":{"build":{"context":".","dockerfile":".lagoon/cli.dockerfile","args":{"DOCKER_CLI_IMAGE_URI":"","ENVIRONMENT_TYPE_ID":""}},"container_name":"_cli","environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"user":"root","volumes":[{"type":"bind","source":"./.lagoon/scripts/bash_prompts.rc","target":"/home/.bashrc","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/scripts/color_grid.sh","target":"/home/color_grid.sh","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"container_name":"_db","environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"image":"amazeeio/mariadb-drupal","labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}],"volumes":[{"type":"volume","source":"mysql","target":"/var/lib/mysql","volume":{}}]},"nginx":{"build":{"context":".","dockerfile":".lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"","DOCKER_NGINX_IMAGE_URI":"","LAGOON_GIT_BRANCH":null}},"container_name":"_nginx","depends_on":{"cli":{"condition":"service_started"}},"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_LOCALDEV_URL":"http://","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":"./.lagoon/nginx/nginx-http.conf","target":"/etc/nginx/conf.d/000-nginx-http.conf","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/nginx/app.conf","target":"/etc/nginx/conf.d/app.conf","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".lagoon/php.dockerfile","args":{"CLI_IMAGE":"","DOCKER_PHP_IMAGE_URI":""}},"container_name":"_php","depends_on":{"cli":{"condition":"service_started"}},"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.deployment.servicetype":"php","lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files","lagoon.type":"nginx-php-persistent"},"networks":{"default":null}}},"networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test7_default","ipam":{},"external":false}},"volumes":{"app":{"name":"test7_app","external":false},"mysql":{"name":"test7_mysql","external":false},"solr7":{"name":"test7_solr7","external":false}}}`, + want: `{"name":"test7","networks":{"amazeeio-network":{"name":"amazeeio-network","ipam":{},"external":true},"default":{"name":"test7_default","ipam":{}}},"services":{"cli":{"build":{"context":".","dockerfile":".lagoon/cli.dockerfile","args":{"DOCKER_CLI_IMAGE_URI":"","ENVIRONMENT_TYPE_ID":""}},"command":null,"container_name":"_cli","entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"user":"root","volumes":[{"type":"bind","source":"./.lagoon/scripts/bash_prompts.rc","target":"/home/.bashrc","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/scripts/color_grid.sh","target":"/home/color_grid.sh","bind":{"create_host_path":true}}],"volumes_from":["container:amazeeio-ssh-agent"]},"mariadb":{"command":null,"container_name":"_db","entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"image":"amazeeio/mariadb-drupal","labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}],"volumes":[{"type":"volume","source":"mysql","target":"/var/lib/mysql","volume":{}}]},"nginx":{"build":{"context":".","dockerfile":".lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"","DOCKER_NGINX_IMAGE_URI":""}},"command":null,"container_name":"_nginx","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_LOCALDEV_URL":"http://","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"amazeeio-network":null,"default":null},"volumes":[{"type":"bind","source":"./.lagoon/nginx/nginx-http.conf","target":"/etc/nginx/conf.d/000-nginx-http.conf","bind":{"create_host_path":true}},{"type":"bind","source":"./.lagoon/nginx/app.conf","target":"/etc/nginx/conf.d/app.conf","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":".lagoon/php.dockerfile","args":{"CLI_IMAGE":"","DOCKER_PHP_IMAGE_URI":""}},"command":null,"container_name":"_php","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"labels":{"lagoon.deployment.servicetype":"php","lagoon.name":"nginx","lagoon.persistent":"/app/docroot/sites/default/files","lagoon.type":"nginx-php-persistent"},"networks":{"default":null}}},"volumes":{"app":{"name":"test7_app"},"mysql":{"name":"test7_mysql"},"solr7":{"name":"test7_solr7"}},"x-environment":{"ENVIRONMENT_TYPE_ID":"","LAGOON_ENVIRONMENT_TYPE":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"http://","PHP_MEMORY_LIMIT":"768M","XDEBUG_ENABLE":""},"x-lagoon-project":"","x-site-branch":{},"x-user":{"user":""}}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "cli"}, {Index: 1, Name: "nginx"}, @@ -137,7 +137,7 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { ignoreNonStringKeyErrors: true, ignoreMissingEnvFiles: true, }, - want: `{"name":"test9","services":{"cli":{"build":{"context":".","dockerfile":"lagoon/cli.dockerfile"},"container_name":"-cli","environment":{"DRUSH_OPTIONS_URI":"https://","LAGOON_PROJECT":"","LAGOON_ROUTE":"https://","SIMPLETEST_BASE_URL":"http://nginx:8080","SIMPLETEST_DB":"mysql://drupal:drupal@mariadb:3306/drupal","SSMTP_MAILHUB":"host.docker.internal:1025"},"labels":{"lagoon.persistent":"/app/public/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"ssh","target":"/tmp/amazeeio_ssh-agent","volume":{}}]},"mariadb":{"container_name":"-db","environment":{"LAGOON_PROJECT":"","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"image":"uselagoon/mariadb-drupal:latest","labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":"lagoon/nginx.dockerfile","args":{"CLI_IMAGE":""}},"container_name":"-nginx","depends_on":{"cli":{"condition":"service_started"}},"environment":{"LAGOON_LOCALDEV_URL":"","LAGOON_PROJECT":"","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"labels":{"lagoon.persistent":"/app/public/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null,"stonehenge-network":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":"lagoon/php.dockerfile","args":{"CLI_IMAGE":""}},"container_name":"-php","depends_on":{"cli":{"condition":"service_started"}},"environment":{"LAGOON_PROJECT":"","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/public/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"pma":{"container_name":"-pma","environment":{"PMA_HOST":"mariadb","PMA_PASSWORD":"drupal","PMA_USER":"drupal","UPLOAD_LIMIT":"1G"},"image":"phpmyadmin/phpmyadmin","labels":{"lagoon.type":"none"},"networks":{"default":null,"stonehenge-network":null}}},"networks":{"default":{"name":"test9_default","ipam":{},"external":false},"stonehenge-network":{"name":"stonehenge-network","ipam":{},"external":true}},"volumes":{"es_data":{"name":"test9_es_data","external":false},"ssh":{"name":"stonehenge-ssh","external":true}}}`, + want: `{"name":"test9","networks":{"default":{"name":"test9_default","ipam":{}},"stonehenge-network":{"name":"stonehenge-network","ipam":{},"external":true}},"services":{"cli":{"build":{"context":".","dockerfile":"lagoon/cli.dockerfile"},"command":null,"container_name":"test9-cli","entrypoint":null,"environment":{"DRUSH_OPTIONS_URI":"https://","LAGOON_PROJECT":"test9","LAGOON_ROUTE":"https://","SIMPLETEST_BASE_URL":"http://nginx:8080","SIMPLETEST_DB":"mysql://drupal:drupal@mariadb:3306/drupal","SSMTP_MAILHUB":"host.docker.internal:1025"},"image":"test9","labels":{"lagoon.persistent":"/app/public/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"ssh","target":"/tmp/amazeeio_ssh-agent","volume":{}}]},"mariadb":{"command":null,"container_name":"test9-db","entrypoint":null,"environment":{"LAGOON_PROJECT":"test9","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"image":"uselagoon/mariadb-drupal:latest","labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":"lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"test9"}},"command":null,"container_name":"test9-nginx","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"LAGOON_LOCALDEV_URL":"","LAGOON_PROJECT":"test9","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"labels":{"lagoon.persistent":"/app/public/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null,"stonehenge-network":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":"lagoon/php.dockerfile","args":{"CLI_IMAGE":"test9"}},"command":null,"container_name":"test9-php","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"LAGOON_PROJECT":"test9","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/public/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"pma":{"command":null,"container_name":"test9-pma","entrypoint":null,"environment":{"PMA_HOST":"mariadb","PMA_PASSWORD":"drupal","PMA_USER":"drupal","UPLOAD_LIMIT":"1G"},"image":"phpmyadmin/phpmyadmin","labels":{"lagoon.type":"none"},"networks":{"default":null,"stonehenge-network":null}}},"volumes":{"es_data":{"name":"test9_es_data"},"ssh":{"name":"stonehenge-ssh","external":true}},"x-environment":{"LAGOON_PROJECT":"test9","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"x-lagoon-project":"test9"}`, wantOrder: []OriginalServiceOrder{ {Index: 0, Name: "cli"}, {Index: 1, Name: "nginx"}, @@ -162,6 +162,30 @@ func TestUnmarshaDockerComposeYAML(t *testing.T) { wantErr: true, wantErrMsg: "Service name is invalid. Please refer to the documentation regarding service naming requirements", }, + { + name: "test12 check a valid docker-compose with newer version of optional env_files", + args: args{ + file: "../../test-resources/docker-compose/test12/docker-compose.yml", + ignoreNonStringKeyErrors: true, + ignoreMissingEnvFiles: true, + }, + want: `{"name":"test12","networks":{"default":{"name":"test12_default","ipam":{}},"stonehenge-network":{"name":"stonehenge-network","ipam":{},"external":true}},"services":{"cli":{"build":{"context":".","dockerfile":"lagoon/cli.dockerfile"},"command":null,"container_name":"test12-cli","entrypoint":null,"environment":{"DRUSH_OPTIONS_URI":"https://","LAGOON_PROJECT":"test12","LAGOON_ROUTE":"https://","SIMPLETEST_BASE_URL":"http://nginx:8080","SIMPLETEST_DB":"mysql://drupal:drupal@mariadb:3306/drupal","SSMTP_MAILHUB":"host.docker.internal:1025"},"image":"test12","labels":{"lagoon.persistent":"/app/public/sites/default/files/","lagoon.persistent.name":"nginx","lagoon.type":"cli-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}},{"type":"volume","source":"ssh","target":"/tmp/amazeeio_ssh-agent","volume":{}}]},"mariadb":{"command":null,"container_name":"test12-db","entrypoint":null,"environment":{"LAGOON_PROJECT":"test12","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"image":"uselagoon/mariadb-drupal:latest","labels":{"lagoon.type":"mariadb"},"networks":{"default":null},"ports":[{"mode":"ingress","target":3306,"protocol":"tcp"}]},"nginx":{"build":{"context":".","dockerfile":"lagoon/nginx.dockerfile","args":{"CLI_IMAGE":"test12"}},"command":null,"container_name":"test12-nginx","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"LAGOON_LOCALDEV_URL":"","LAGOON_PROJECT":"test12","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"labels":{"lagoon.persistent":"/app/public/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null,"stonehenge-network":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"php":{"build":{"context":".","dockerfile":"lagoon/php.dockerfile","args":{"CLI_IMAGE":"test12"}},"command":null,"container_name":"test12-php","depends_on":{"cli":{"condition":"service_started","required":true}},"entrypoint":null,"environment":{"LAGOON_PROJECT":"test12","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"labels":{"lagoon.name":"nginx","lagoon.persistent":"/app/public/sites/default/files/","lagoon.type":"nginx-php-persistent"},"networks":{"default":null},"volumes":[{"type":"bind","source":".","target":"/app","bind":{"create_host_path":true}}]},"pma":{"command":null,"container_name":"test12-pma","entrypoint":null,"environment":{"PMA_HOST":"mariadb","PMA_PASSWORD":"drupal","PMA_USER":"drupal","UPLOAD_LIMIT":"1G"},"image":"phpmyadmin/phpmyadmin","labels":{"lagoon.type":"none"},"networks":{"default":null,"stonehenge-network":null}}},"volumes":{"es_data":{"name":"test12_es_data"},"ssh":{"name":"stonehenge-ssh","external":true}},"x-environment":{"LAGOON_PROJECT":"test12","LAGOON_ROUTE":"https://","SSMTP_MAILHUB":"host.docker.internal:1025"},"x-lagoon-project":"test12"}`, + wantOrder: []OriginalServiceOrder{ + {Index: 0, Name: "cli"}, + {Index: 1, Name: "nginx"}, + {Index: 2, Name: "php"}, + {Index: 3, Name: "mariadb"}, + {Index: 4, Name: "pma"}, + }, + }, + { + name: "test13 check a valid docker-compose with newer version of optional env_files (same as test12 but not ignoring the errors)", + args: args{ + file: "../../test-resources/docker-compose/test13/docker-compose.yml", + }, + wantErr: true, + wantErrMsg: "no such file or directory", + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -228,14 +252,14 @@ func TestUnmarshalLagoonDockerComposeYAML(t *testing.T) { wantErrMsg string wantErr bool }{ - { - name: "test1 docker-compose drupal example", - args: args{ - file: "../../test-resources/docker-compose/test1/docker-compose.yml", - }, - wantErr: true, - wantErrMsg: `line 59: mapping key "<<" already defined at line 58`, - }, + // { + // name: "test1 docker-compose drupal example", + // args: args{ + // file: "../../test-resources/docker-compose/test1/docker-compose.yml", + // }, + // wantErr: true, + // wantErrMsg: `line 59: mapping key "<<" already defined at line 58`, + // }, { name: "test2 docker-compose node example", args: args{ @@ -254,14 +278,14 @@ func TestUnmarshalLagoonDockerComposeYAML(t *testing.T) { file: "../../test-resources/docker-compose/test4/docker-compose.yml", }, }, - { - name: "test5 docker-compose complex", - args: args{ - file: "../../test-resources/docker-compose/test5/docker-compose.yml", - }, - wantErr: true, - wantErrMsg: `line 57: mapping key "<<" already defined at line 56`, - }, + // { + // name: "test5 docker-compose complex", + // args: args{ + // file: "../../test-resources/docker-compose/test5/docker-compose.yml", + // }, + // wantErr: true, + // wantErrMsg: `line 57: mapping key "<<" already defined at line 56`, + // }, { name: "test6 docker-compose complex", args: args{ diff --git a/internal/testdata/complex/docker-compose.multi-db.yml b/internal/testdata/complex/docker-compose.multi-db.yml index afd3fcf6..3d0cb31f 100644 --- a/internal/testdata/complex/docker-compose.multi-db.yml +++ b/internal/testdata/complex/docker-compose.multi-db.yml @@ -55,8 +55,7 @@ services: lagoon.type: nginx-php-persistent lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too lando.type: nginx-drupal - << : *default-volumes # loads the defined volumes from the top - << : *default-user # uses the defined user from top + << : [*default-volumes, *default-user] depends_on: - cli # basically just tells docker-compose to build the cli first environment: @@ -77,8 +76,7 @@ services: lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too lando.type: php-fpm - << : *default-volumes # loads the defined volumes from the top - << : *default-user # uses the defined user from top + << : [*default-volumes, *default-user] depends_on: - cli # basically just tells docker-compose to build the cli first environment: diff --git a/legacy/build-deploy-docker-compose.sh b/legacy/build-deploy-docker-compose.sh index be548edb..9da64dd5 100755 --- a/legacy/build-deploy-docker-compose.sh +++ b/legacy/build-deploy-docker-compose.sh @@ -248,6 +248,8 @@ You can run docker compose config locally to check that your docker-compose file " if [[ "${dccOutput}" =~ "no such file or directory" ]]; then echo "> an env_file is defined in your docker-compose file, but no matching file found." + echo ">> See https://docs.docker.com/compose/compose-file/05-services/#env_file if and the new env_file attributes for 'required' env_files." + echo ">> Consider setting these files to 'required: false' when using Lagoon to prevent this warning from appearing again" fi if [[ "${dccOutput}" =~ "Non-string key" ]]; then echo "> an invalid string key was detected in your docker-compose file." diff --git a/test-resources/docker-compose/test1/docker-compose.yml b/test-resources/docker-compose/test1/docker-compose.yml index 51ec1413..925fb74e 100644 --- a/test-resources/docker-compose/test1/docker-compose.yml +++ b/test-resources/docker-compose/test1/docker-compose.yml @@ -55,8 +55,7 @@ services: lagoon.type: nginx-php-persistent lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too lando.type: nginx-drupal - << : *default-volumes # loads the defined volumes from the top - << : *default-user # uses the defined user from top + << : [*default-volumes, *default-user] depends_on: - cli # basically just tells docker-compose to build the cli first environment: @@ -77,8 +76,7 @@ services: lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too lando.type: php-fpm - << : *default-volumes # loads the defined volumes from the top - << : *default-user # uses the defined user from top + << : [*default-volumes, *default-user] depends_on: - cli # basically just tells docker-compose to build the cli first environment: diff --git a/test-resources/docker-compose/test12/docker-compose.yml b/test-resources/docker-compose/test12/docker-compose.yml new file mode 100644 index 00000000..d018f9d0 --- /dev/null +++ b/test-resources/docker-compose/test12/docker-compose.yml @@ -0,0 +1,113 @@ +version: '2.3' + +x-lagoon-project: + # Lagoon project name (leave `&lagoon-project` when you edit this) + &lagoon-project "${COMPOSE_PROJECT_NAME}" + +x-environment: + &default-environment + LAGOON_PROJECT: *lagoon-project + # Route that should be used locally + LAGOON_ROUTE: "https://${DRUPAL_HOSTNAME}" + SSMTP_MAILHUB: "host.docker.internal:1025" + +services: + + cli: # cli container, will be used for executing composer and any local commands (drush, drupal, etc.) + container_name: "${COMPOSE_PROJECT_NAME}-cli" + build: + context: . + dockerfile: lagoon/cli.dockerfile + image: *lagoon-project # this image will be reused as `CLI_IMAGE` in subsequent Docker builds + labels: + # Lagoon Labels + lagoon.type: cli-persistent + lagoon.persistent.name: nginx # mount the persistent storage of nginx into this container + lagoon.persistent: "/app/public/sites/default/files/" # location where the persistent storage should be mounted + volumes: + - .:/app:delegated + - ssh:/tmp/amazeeio_ssh-agent + environment: + << : *default-environment # loads the defined environment variables from the top + SIMPLETEST_BASE_URL: "http://nginx:8080" + SIMPLETEST_DB: "mysql://drupal:drupal@mariadb:3306/drupal" + DRUSH_OPTIONS_URI: "https://${DRUPAL_HOSTNAME}" + env_file: + - path: .env.local + required: true + + nginx: + container_name: "${COMPOSE_PROJECT_NAME}-nginx" + build: + context: . + dockerfile: lagoon/nginx.dockerfile + args: + CLI_IMAGE: *lagoon-project # Inject the name of the cli image + labels: + lagoon.type: nginx-php-persistent + lagoon.persistent: "/app/public/sites/default/files/" # define where the persistent file storage should be mounted too + volumes: + - .:/app:delegated + depends_on: + - cli # basically just tells docker-compose to build the cli first + environment: + << : *default-environment # loads the defined environment variables from the top + LAGOON_LOCALDEV_URL: "${DRUPAL_HOSTNAME}" # generate another route for nginx, by default we go to varnish + networks: + - stonehenge-network + - default + + php: + container_name: "${COMPOSE_PROJECT_NAME}-php" + build: + context: . + dockerfile: lagoon/php.dockerfile + args: + CLI_IMAGE: *lagoon-project + labels: + lagoon.type: nginx-php-persistent + lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon + lagoon.persistent: /app/public/sites/default/files/ # define where the persistent storage should be mounted too + volumes: + - .:/app:delegated + depends_on: + - cli # basically just tells docker-compose to build the cli first + environment: + << : *default-environment # loads the defined environment variables from the top + env_file: + - path: .env.local + required: false + + mariadb: + container_name: "${COMPOSE_PROJECT_NAME}-db" + image: uselagoon/mariadb-drupal:latest + labels: + lagoon.type: mariadb + ports: + - "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306` + environment: + << : *default-environment + + pma: + image: phpmyadmin/phpmyadmin + container_name: "${COMPOSE_PROJECT_NAME}-pma" + environment: + PMA_HOST: mariadb + PMA_USER: drupal + PMA_PASSWORD: drupal + UPLOAD_LIMIT: 1G + labels: + lagoon.type: none + networks: + - default + - stonehenge-network + +networks: + stonehenge-network: + external: true + +volumes: + es_data: + ssh: + name: stonehenge-ssh + external: true \ No newline at end of file diff --git a/test-resources/docker-compose/test13/docker-compose.yml b/test-resources/docker-compose/test13/docker-compose.yml new file mode 100644 index 00000000..d018f9d0 --- /dev/null +++ b/test-resources/docker-compose/test13/docker-compose.yml @@ -0,0 +1,113 @@ +version: '2.3' + +x-lagoon-project: + # Lagoon project name (leave `&lagoon-project` when you edit this) + &lagoon-project "${COMPOSE_PROJECT_NAME}" + +x-environment: + &default-environment + LAGOON_PROJECT: *lagoon-project + # Route that should be used locally + LAGOON_ROUTE: "https://${DRUPAL_HOSTNAME}" + SSMTP_MAILHUB: "host.docker.internal:1025" + +services: + + cli: # cli container, will be used for executing composer and any local commands (drush, drupal, etc.) + container_name: "${COMPOSE_PROJECT_NAME}-cli" + build: + context: . + dockerfile: lagoon/cli.dockerfile + image: *lagoon-project # this image will be reused as `CLI_IMAGE` in subsequent Docker builds + labels: + # Lagoon Labels + lagoon.type: cli-persistent + lagoon.persistent.name: nginx # mount the persistent storage of nginx into this container + lagoon.persistent: "/app/public/sites/default/files/" # location where the persistent storage should be mounted + volumes: + - .:/app:delegated + - ssh:/tmp/amazeeio_ssh-agent + environment: + << : *default-environment # loads the defined environment variables from the top + SIMPLETEST_BASE_URL: "http://nginx:8080" + SIMPLETEST_DB: "mysql://drupal:drupal@mariadb:3306/drupal" + DRUSH_OPTIONS_URI: "https://${DRUPAL_HOSTNAME}" + env_file: + - path: .env.local + required: true + + nginx: + container_name: "${COMPOSE_PROJECT_NAME}-nginx" + build: + context: . + dockerfile: lagoon/nginx.dockerfile + args: + CLI_IMAGE: *lagoon-project # Inject the name of the cli image + labels: + lagoon.type: nginx-php-persistent + lagoon.persistent: "/app/public/sites/default/files/" # define where the persistent file storage should be mounted too + volumes: + - .:/app:delegated + depends_on: + - cli # basically just tells docker-compose to build the cli first + environment: + << : *default-environment # loads the defined environment variables from the top + LAGOON_LOCALDEV_URL: "${DRUPAL_HOSTNAME}" # generate another route for nginx, by default we go to varnish + networks: + - stonehenge-network + - default + + php: + container_name: "${COMPOSE_PROJECT_NAME}-php" + build: + context: . + dockerfile: lagoon/php.dockerfile + args: + CLI_IMAGE: *lagoon-project + labels: + lagoon.type: nginx-php-persistent + lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon + lagoon.persistent: /app/public/sites/default/files/ # define where the persistent storage should be mounted too + volumes: + - .:/app:delegated + depends_on: + - cli # basically just tells docker-compose to build the cli first + environment: + << : *default-environment # loads the defined environment variables from the top + env_file: + - path: .env.local + required: false + + mariadb: + container_name: "${COMPOSE_PROJECT_NAME}-db" + image: uselagoon/mariadb-drupal:latest + labels: + lagoon.type: mariadb + ports: + - "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306` + environment: + << : *default-environment + + pma: + image: phpmyadmin/phpmyadmin + container_name: "${COMPOSE_PROJECT_NAME}-pma" + environment: + PMA_HOST: mariadb + PMA_USER: drupal + PMA_PASSWORD: drupal + UPLOAD_LIMIT: 1G + labels: + lagoon.type: none + networks: + - default + - stonehenge-network + +networks: + stonehenge-network: + external: true + +volumes: + es_data: + ssh: + name: stonehenge-ssh + external: true \ No newline at end of file diff --git a/test-resources/docker-compose/test5/docker-compose.yml b/test-resources/docker-compose/test5/docker-compose.yml index 992a85ca..0efb3a8f 100644 --- a/test-resources/docker-compose/test5/docker-compose.yml +++ b/test-resources/docker-compose/test5/docker-compose.yml @@ -53,8 +53,7 @@ services: dockerfile: .docker/Dockerfile.nginx-drupal args: CLI_IMAGE: *project - <<: *default-volumes - <<: *default-user + << : [*default-volumes, *default-user] environment: <<: *default-environment depends_on: @@ -74,8 +73,7 @@ services: dockerfile: .docker/Dockerfile.php args: CLI_IMAGE: *project - <<: *default-volumes - <<: *default-user + << : [*default-volumes, *default-user] environment: <<: *default-environment depends_on: