diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-11 21:22:43 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-11 21:22:43 -0600 |
| commit | 05fae21a33b74e7768a94eb84294f6198c3cec56 (patch) | |
| tree | fce6d4813f10704d3d17ba69e235e097da1f0574 /vendor/github.com/testcontainers | |
| parent | b1b29603622451f677f61be9300987ee3e79a2ff (diff) | |
chore: update go modules
Diffstat (limited to 'vendor/github.com/testcontainers')
24 files changed, 606 insertions, 269 deletions
diff --git a/vendor/github.com/testcontainers/testcontainers-go/.golangci.yml b/vendor/github.com/testcontainers/testcontainers-go/.golangci.yml index 7db1f4d..8d66883 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/.golangci.yml +++ b/vendor/github.com/testcontainers/testcontainers-go/.golangci.yml @@ -1,86 +1,89 @@ +formatters: + enable: + - gci + - gofumpt + settings: + gci: + sections: + - standard + - default + - prefix(github.com/testcontainers) linters: enable: - - errcheck - errorlint - - gci - gocritic - - gofumpt - misspell - - nolintlint - nakedret + - nolintlint - perfsprint - revive - testifylint - thelper - usestdlibvars - -linters-settings: - errorlint: - # Check whether fmt.Errorf uses the %w verb for formatting errors. - # See the https://github.com/polyfloyd/go-errorlint for caveats. - errorf: true - # Permit more than 1 %w verb, valid per Go 1.20 (Requires errorf:true) - errorf-multi: true - # Check for plain type assertions and type switches. - asserts: true - # Check for plain error comparisons. - comparison: true - gci: - sections: - - standard - - default - - prefix(github.com/testcontainers) - nakedret: - max-func-lines: 0 - revive: - rules: - - name: blank-imports - - name: context-as-argument - arguments: - - allowTypesBefore: "*testing.T" - - name: context-keys-type - - name: dot-imports - - name: early-return - arguments: - - "preserveScope" - - name: empty-block - - name: error-naming - disabled: true - - name: error-return - - name: error-strings - disabled: true - - name: errorf - - name: increment-decrement - - name: indent-error-flow - arguments: - - "preserveScope" - - name: range - - name: receiver-naming - - name: redefines-builtin-id - disabled: true - - name: superfluous-else - arguments: - - "preserveScope" - - name: time-naming - - name: unexported-return - disabled: true - - name: unreachable-code - - name: unused-parameter - - name: use-any - - name: var-declaration - - name: var-naming - arguments: - - ["ID"] # AllowList - - ["VM"] # DenyList - - - upperCaseConst: true # Extra parameter (upperCaseConst|skipPackageNameChecks) - testifylint: - disable: - - float-compare - - go-require - enable-all: true + exclusions: + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + settings: + errorlint: + asserts: true + comparison: true + errorf: true + errorf-multi: true + revive: + rules: + - name: blank-imports + - name: context-as-argument + arguments: + - allowTypesBefore: '*testing.T' + - name: context-keys-type + - name: dot-imports + - name: early-return + arguments: + - preserveScope + - name: empty-block + - name: error-naming + disabled: true + - name: error-return + - name: error-strings + disabled: true + - name: errorf + - name: increment-decrement + - name: indent-error-flow + arguments: + - preserveScope + - name: range + - name: receiver-naming + - name: redefines-builtin-id + disabled: true + - name: superfluous-else + arguments: + - preserveScope + - name: time-naming + - name: unexported-return + disabled: true + - name: unreachable-code + - name: unused-parameter + - name: use-any + - name: var-declaration + - name: var-naming + arguments: + - - ID + - - VM + - - upperCaseConst: true + staticcheck: + checks: + - all + testifylint: + disable: + - float-compare + - go-require + enable-all: true output: formats: - - format: colored-line-number - path-prefix: "." -run: - timeout: 5m + text: + path: stdout + path-prefix: . +version: "2" diff --git a/vendor/github.com/testcontainers/testcontainers-go/Makefile b/vendor/github.com/testcontainers/testcontainers-go/Makefile index 8edc9d4..de6ccbd 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/Makefile +++ b/vendor/github.com/testcontainers/testcontainers-go/Makefile @@ -24,7 +24,7 @@ tidy-all: ## -------------------------------------- DOCS_CONTAINER=mkdocs-container -DOCS_IMAGE=python:3.8 +DOCS_IMAGE=python:3.13 .PHONY: clean-docs clean-docs: diff --git a/vendor/github.com/testcontainers/testcontainers-go/Pipfile b/vendor/github.com/testcontainers/testcontainers-go/Pipfile index 2648278..f35e8eb 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/Pipfile +++ b/vendor/github.com/testcontainers/testcontainers-go/Pipfile @@ -8,9 +8,9 @@ verify_ssl = true [packages] mkdocs = "==1.5.3" mkdocs-codeinclude-plugin = "==0.2.1" -mkdocs-include-markdown-plugin = "==6.2.2" +mkdocs-include-markdown-plugin = "==7.1.5" mkdocs-material = "==9.5.18" mkdocs-markdownextradata-plugin = "==0.2.6" [requires] -python_version = "3.8" +python_version = "3.13" diff --git a/vendor/github.com/testcontainers/testcontainers-go/Pipfile.lock b/vendor/github.com/testcontainers/testcontainers-go/Pipfile.lock index d08964a..e3b2e97 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/Pipfile.lock +++ b/vendor/github.com/testcontainers/testcontainers-go/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "0411eac13d1b06b42671b8a654fb269eb0c329d9a3d41f669ccf7b653ef8ad32" + "sha256": "4a9599a9c2db79998493adaaa691752f995ed409e15840df5aae155c83963d51" }, "pipfile-spec": 6, "requires": { @@ -26,11 +26,11 @@ }, "bracex": { "hashes": [ - "sha256:0725da5045e8d37ea9592ab3614d8b561e22c3c5fde3964699be672e072ab611", - "sha256:d2fcf4b606a82ac325471affe1706dd9bbaa3536c91ef86a31f6b766f3dad1d0" + "sha256:12c50952415bfa773d2d9ccb8e79651b8cdb1f31a42f6091b804f6ba2b4a66b6", + "sha256:13e5732fec27828d6af308628285ad358047cec36801598368cb28bc631dbaf6" ], "markers": "python_version >= '3.8'", - "version": "==2.5" + "version": "==2.5.post1" }, "certifi": { "hashes": [ @@ -139,11 +139,11 @@ }, "click": { "hashes": [ - "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", - "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" + "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2", + "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a" ], "markers": "python_version >= '3.7'", - "version": "==8.1.7" + "version": "==8.1.8" }, "colorama": { "hashes": [ @@ -178,86 +178,86 @@ }, "jinja2": { "hashes": [ - "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb", - "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb" + "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", + "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67" ], - "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==3.1.5" + "version": "==3.1.6" }, "markdown": { "hashes": [ - "sha256:2ae2471477cfd02dbbf038d5d9bc226d40def84b4fe2986e49b59b6b472bbed2", - "sha256:7eb6df5690b81a1d7942992c97fad2938e956e79df20cbc6186e9c3a77b1c803" + "sha256:794a929b79c5af141ef5ab0f2f642d0f7b1872981250230e72682346f7cc90dc", + "sha256:7df81e63f0df5c4b24b7d156eb81e4690595239b7d70937d0409f1b0de319c6f" ], - "markers": "python_version >= '3.8'", - "version": "==3.7" + "markers": "python_version >= '3.9'", + "version": "==3.8" }, "markupsafe": { "hashes": [ - "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf", - "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff", - "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f", - "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3", - "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532", - "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f", - "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617", - "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df", - "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4", - "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906", - "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f", - "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4", - "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8", - "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371", - "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2", - "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465", - "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52", - "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6", - "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169", - "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad", - "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2", - "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0", - "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029", - "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f", - "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a", - "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced", - "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5", - "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c", - "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf", - "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9", - "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb", - "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad", - "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3", - "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1", - "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46", - "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc", - "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a", - "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee", - "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900", - "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5", - "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea", - "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f", - "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5", - "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e", - "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a", - "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f", - "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50", - "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a", - "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b", - "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4", - "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff", - "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2", - "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46", - "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b", - "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf", - "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5", - "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5", - "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab", - "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd", - "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68" - ], - "markers": "python_version >= '3.7'", - "version": "==2.1.5" + "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4", + "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30", + "sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0", + "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", + "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", + "sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13", + "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028", + "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca", + "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557", + "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832", + "sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0", + "sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b", + "sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579", + "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", + "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", + "sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff", + "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", + "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22", + "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", + "sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb", + "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e", + "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", + "sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a", + "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d", + "sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a", + "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b", + "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8", + "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225", + "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c", + "sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144", + "sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f", + "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87", + "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d", + "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93", + "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf", + "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158", + "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84", + "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", + "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48", + "sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171", + "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", + "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", + "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", + "sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d", + "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", + "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", + "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", + "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", + "sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29", + "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", + "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798", + "sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c", + "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8", + "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", + "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", + "sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a", + "sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178", + "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", + "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", + "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", + "sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50" + ], + "markers": "python_version >= '3.9'", + "version": "==3.0.2" }, "mergedeep": { "hashes": [ @@ -287,12 +287,12 @@ }, "mkdocs-include-markdown-plugin": { "hashes": [ - "sha256:d293950f6499d2944291ca7b9bc4a60e652bbfd3e3a42b564f6cceee268694e7", - "sha256:f2bd5026650492a581d2fd44be6c22f90391910d76582b96a34c264f2d17875d" + "sha256:a986967594da6789226798e3c41c70bc17130fadb92b4313f42bd3defdac0adc", + "sha256:d0b96edee45e7fda5eb189e63331cfaf1bf1fbdbebbd08371f1daa77045d3ae9" ], "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==6.2.2" + "markers": "python_version >= '3.9'", + "version": "==7.1.5" }, "mkdocs-markdownextradata-plugin": { "hashes": [ @@ -322,11 +322,11 @@ }, "packaging": { "hashes": [ - "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", - "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124" + "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", + "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f" ], "markers": "python_version >= '3.8'", - "version": "==24.1" + "version": "==25.0" }, "paginate": { "hashes": [ @@ -344,11 +344,11 @@ }, "platformdirs": { "hashes": [ - "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee", - "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3" + "sha256:a03875334331946f13c549dbd8f4bac7a13a50a895a0eb1e8c6a8ace80d40a94", + "sha256:eb437d586b6a0986388f0d6f74aa0cde27b48d0e3d66843640bfb6bdcdb6e351" ], - "markers": "python_version >= '3.8'", - "version": "==4.2.2" + "markers": "python_version >= '3.9'", + "version": "==4.3.7" }, "pygments": { "hashes": [ @@ -371,7 +371,7 @@ "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==2.9.0.post0" }, "pytz": { @@ -545,11 +545,11 @@ }, "six": { "hashes": [ - "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", - "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", + "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.16.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "version": "==1.17.0" }, "urllib3": { "hashes": [ @@ -562,52 +562,47 @@ }, "watchdog": { "hashes": [ - "sha256:0b4359067d30d5b864e09c8597b112fe0a0a59321a0f331498b013fb097406b4", - "sha256:0d8a7e523ef03757a5aa29f591437d64d0d894635f8a50f370fe37f913ce4e19", - "sha256:0e83619a2d5d436a7e58a1aea957a3c1ccbf9782c43c0b4fed80580e5e4acd1a", - "sha256:10b6683df70d340ac3279eff0b2766813f00f35a1d37515d2c99959ada8f05fa", - "sha256:132937547a716027bd5714383dfc40dc66c26769f1ce8a72a859d6a48f371f3a", - "sha256:1cdcfd8142f604630deef34722d695fb455d04ab7cfe9963055df1fc69e6727a", - "sha256:2d468028a77b42cc685ed694a7a550a8d1771bb05193ba7b24006b8241a571a1", - "sha256:32be97f3b75693a93c683787a87a0dc8db98bb84701539954eef991fb35f5fbc", - "sha256:770eef5372f146997638d737c9a3c597a3b41037cfbc5c41538fc27c09c3a3f9", - "sha256:7c7d4bf585ad501c5f6c980e7be9c4f15604c7cc150e942d82083b31a7548930", - "sha256:88456d65f207b39f1981bf772e473799fcdc10801062c36fd5ad9f9d1d463a73", - "sha256:914285126ad0b6eb2258bbbcb7b288d9dfd655ae88fa28945be05a7b475a800b", - "sha256:936acba76d636f70db8f3c66e76aa6cb5136a936fc2a5088b9ce1c7a3508fc83", - "sha256:980b71510f59c884d684b3663d46e7a14b457c9611c481e5cef08f4dd022eed7", - "sha256:984306dc4720da5498b16fc037b36ac443816125a3705dfde4fd90652d8028ef", - "sha256:a2cffa171445b0efa0726c561eca9a27d00a1f2b83846dbd5a4f639c4f8ca8e1", - "sha256:aa160781cafff2719b663c8a506156e9289d111d80f3387cf3af49cedee1f040", - "sha256:b2c45f6e1e57ebb4687690c05bc3a2c1fb6ab260550c4290b8abb1335e0fd08b", - "sha256:b4dfbb6c49221be4535623ea4474a4d6ee0a9cef4a80b20c28db4d858b64e270", - "sha256:baececaa8edff42cd16558a639a9b0ddf425f93d892e8392a56bf904f5eff22c", - "sha256:bcfd02377be80ef3b6bc4ce481ef3959640458d6feaae0bd43dd90a43da90a7d", - "sha256:c0b14488bd336c5b1845cee83d3e631a1f8b4e9c5091ec539406e4a324f882d8", - "sha256:c100d09ac72a8a08ddbf0629ddfa0b8ee41740f9051429baa8e31bb903ad7508", - "sha256:c344453ef3bf875a535b0488e3ad28e341adbd5a9ffb0f7d62cefacc8824ef2b", - "sha256:c50f148b31b03fbadd6d0b5980e38b558046b127dc483e5e4505fcef250f9503", - "sha256:c82253cfc9be68e3e49282831afad2c1f6593af80c0daf1287f6a92657986757", - "sha256:cd67c7df93eb58f360c43802acc945fa8da70c675b6fa37a241e17ca698ca49b", - "sha256:d7ab624ff2f663f98cd03c8b7eedc09375a911794dfea6bf2a359fcc266bff29", - "sha256:e252f8ca942a870f38cf785aef420285431311652d871409a64e2a0a52a2174c", - "sha256:ede7f010f2239b97cc79e6cb3c249e72962404ae3865860855d5cbe708b0fd22", - "sha256:eeea812f38536a0aa859972d50c76e37f4456474b02bd93674d1947cf1e39578", - "sha256:f15edcae3830ff20e55d1f4e743e92970c847bcddc8b7509bcd172aa04de506e", - "sha256:f5315a8c8dd6dd9425b974515081fc0aadca1d1d61e078d2246509fd756141ee", - "sha256:f6ee8dedd255087bc7fe82adf046f0b75479b989185fb0bdf9a98b612170eac7", - "sha256:f7c739888c20f99824f7aa9d31ac8a97353e22d0c0e54703a547a218f6637eb3" - ], - "markers": "python_version >= '3.8'", - "version": "==4.0.2" + "sha256:07df1fdd701c5d4c8e55ef6cf55b8f0120fe1aef7ef39a1c6fc6bc2e606d517a", + "sha256:20ffe5b202af80ab4266dcd3e91aae72bf2da48c0d33bdb15c66658e685e94e2", + "sha256:212ac9b8bf1161dc91bd09c048048a95ca3a4c4f5e5d4a7d1b1a7d5752a7f96f", + "sha256:2cce7cfc2008eb51feb6aab51251fd79b85d9894e98ba847408f662b3395ca3c", + "sha256:490ab2ef84f11129844c23fb14ecf30ef3d8a6abafd3754a6f75ca1e6654136c", + "sha256:6eb11feb5a0d452ee41f824e271ca311a09e250441c262ca2fd7ebcf2461a06c", + "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0", + "sha256:7607498efa04a3542ae3e05e64da8202e58159aa1fa4acddf7678d34a35d4f13", + "sha256:76aae96b00ae814b181bb25b1b98076d5fc84e8a53cd8885a318b42b6d3a5134", + "sha256:7a0e56874cfbc4b9b05c60c8a1926fedf56324bb08cfbc188969777940aef3aa", + "sha256:82dc3e3143c7e38ec49d61af98d6558288c415eac98486a5c581726e0737c00e", + "sha256:9041567ee8953024c83343288ccc458fd0a2d811d6a0fd68c4c22609e3490379", + "sha256:90c8e78f3b94014f7aaae121e6b909674df5b46ec24d6bebc45c44c56729af2a", + "sha256:9513f27a1a582d9808cf21a07dae516f0fab1cf2d7683a742c498b93eedabb11", + "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", + "sha256:a175f755fc2279e0b7312c0035d52e27211a5bc39719dd529625b1930917345b", + "sha256:a1914259fa9e1454315171103c6a30961236f508b9b623eae470268bbcc6a22f", + "sha256:afd0fe1b2270917c5e23c2a65ce50c2a4abb63daafb0d419fde368e272a76b7c", + "sha256:bc64ab3bdb6a04d69d4023b29422170b74681784ffb9463ed4870cf2f3e66112", + "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948", + "sha256:c7ac31a19f4545dd92fc25d200694098f42c9a8e391bc00bdd362c5736dbf881", + "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860", + "sha256:c897ac1b55c5a1461e16dae288d22bb2e412ba9807df8397a635d88f671d36c3", + "sha256:cbafb470cf848d93b5d013e2ecb245d4aa1c8fd0504e863ccefa32445359d680", + "sha256:d1cdb490583ebd691c012b3d6dae011000fe42edb7a82ece80965b42abd61f26", + "sha256:e3df4cbb9a450c6d49318f6d14f4bbc80d763fa587ba46ec86f99f9e6876bb26", + "sha256:e6439e374fc012255b4ec786ae3c4bc838cd7309a540e5fe0952d03687d8804e", + "sha256:e6f0e77c9417e7cd62af82529b10563db3423625c5fce018430b249bf977f9e8", + "sha256:e7631a77ffb1f7d2eefa4445ebbee491c720a5661ddf6df3498ebecae5ed375c", + "sha256:ef810fbf7b781a5a593894e4f439773830bdecb885e6880d957d5b9382a960d2" + ], + "markers": "python_version >= '3.9'", + "version": "==6.0.0" }, "wcmatch": { "hashes": [ - "sha256:567d66b11ad74384954c8af86f607857c3bdf93682349ad32066231abd556c92", - "sha256:af25922e2b6dbd1550fa37a4c8de7dd558d6c1bb330c641de9b907b9776cb3c4" + "sha256:0dd927072d03c0a6527a20d2e6ad5ba8d0380e60870c383bc533b71744df7b7a", + "sha256:e72f0de09bba6a04e0de70937b0cf06e55f36f37b3deb422dfaf854b867b840a" ], "markers": "python_version >= '3.8'", - "version": "==9.0" + "version": "==10.0" }, "zipp": { "hashes": [ diff --git a/vendor/github.com/testcontainers/testcontainers-go/commons-test.mk b/vendor/github.com/testcontainers/testcontainers-go/commons-test.mk index a7a214d..43c55b0 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/commons-test.mk +++ b/vendor/github.com/testcontainers/testcontainers-go/commons-test.mk @@ -6,7 +6,7 @@ define go_install endef $(GOBIN)/golangci-lint: - $(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4) + $(call go_install,github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.0.2) $(GOBIN)/gotestsum: $(call go_install,gotest.tools/gotestsum@latest) diff --git a/vendor/github.com/testcontainers/testcontainers-go/container.go b/vendor/github.com/testcontainers/testcontainers-go/container.go index f1d2a78..1977632 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/container.go +++ b/vendor/github.com/testcontainers/testcontainers-go/container.go @@ -141,17 +141,17 @@ type ContainerRequest struct { Tmpfs map[string]string RegistryCred string // Deprecated: Testcontainers will detect registry credentials automatically WaitingFor wait.Strategy - Name string // for specifying container name - Hostname string - WorkingDir string // specify the working directory of the container + Name string // for specifying container name + Hostname string // Deprecated: Use [ConfigModifier] instead. S + WorkingDir string // Deprecated: Use [ConfigModifier] instead. Specify the working directory of the container ExtraHosts []string // Deprecated: Use HostConfigModifier instead - Privileged bool // For starting privileged container + Privileged bool // Deprecated: Use [HostConfigModifier] instead. For starting privileged container Networks []string // for specifying network names NetworkAliases map[string][]string // for specifying network aliases NetworkMode container.NetworkMode // Deprecated: Use HostConfigModifier instead Resources container.Resources // Deprecated: Use HostConfigModifier instead Files []ContainerFile // files which will be copied when container starts - User string // for specifying uid:gid + User string // Deprecated: Use [ConfigModifier] instead. For specifying uid:gid SkipReaper bool // Deprecated: The reaper is globally controlled by the .testcontainers.properties file or the TESTCONTAINERS_RYUK_DISABLED environment variable ReaperImage string // Deprecated: use WithImageName ContainerOption instead. Alternative reaper image ReaperOptions []ContainerOption // Deprecated: the reaper is configured at the properties level, for an entire test session @@ -159,7 +159,7 @@ type ContainerRequest struct { AlwaysPullImage bool // Always pull image ImagePlatform string // ImagePlatform describes the platform which the image runs on. Binds []string // Deprecated: Use HostConfigModifier instead - ShmSize int64 // Amount of memory shared with the host (in bytes) + ShmSize int64 // Deprecated: Use [HostConfigModifier] instead. Amount of memory shared with the host (in bytes) CapAdd []string // Deprecated: Use HostConfigModifier instead. Add Linux capabilities CapDrop []string // Deprecated: Use HostConfigModifier instead. Drop Linux capabilities ConfigModifier func(*container.Config) // Modifier for the config before container creation @@ -285,37 +285,37 @@ func parseDockerIgnore(targetDir string) (bool, []string, error) { // GetBuildArgs returns the env args to be used when creating from Dockerfile func (c *ContainerRequest) GetBuildArgs() map[string]*string { - return c.FromDockerfile.BuildArgs + return c.BuildArgs } // GetDockerfile returns the Dockerfile from the ContainerRequest, defaults to "Dockerfile". // Sets FromDockerfile.Dockerfile to the default if blank. func (c *ContainerRequest) GetDockerfile() string { - if c.FromDockerfile.Dockerfile == "" { - c.FromDockerfile.Dockerfile = "Dockerfile" + if c.Dockerfile == "" { + c.Dockerfile = "Dockerfile" } - return c.FromDockerfile.Dockerfile + return c.Dockerfile } // GetRepo returns the Repo label for image from the ContainerRequest, defaults to UUID. // Sets FromDockerfile.Repo to the default value if blank. func (c *ContainerRequest) GetRepo() string { - if c.FromDockerfile.Repo == "" { - c.FromDockerfile.Repo = uuid.NewString() + if c.Repo == "" { + c.Repo = uuid.NewString() } - return strings.ToLower(c.FromDockerfile.Repo) + return strings.ToLower(c.Repo) } // GetTag returns the Tag label for image from the ContainerRequest, defaults to UUID. // Sets FromDockerfile.Tag to the default value if blank. func (c *ContainerRequest) GetTag() string { - if c.FromDockerfile.Tag == "" { - c.FromDockerfile.Tag = uuid.NewString() + if c.Tag == "" { + c.Tag = uuid.NewString() } - return strings.ToLower(c.FromDockerfile.Tag) + return strings.ToLower(c.Tag) } // Deprecated: Testcontainers will detect registry credentials automatically, and it will be removed in the next major release. @@ -343,13 +343,13 @@ func (c *ContainerRequest) dockerFileImages() ([]string, error) { // Source is an archive, we need to read it to get the Dockerfile. dockerFile := c.GetDockerfile() - tr := tar.NewReader(c.FromDockerfile.ContextArchive) + tr := tar.NewReader(c.ContextArchive) for { hdr, err := tr.Next() if err != nil { if errors.Is(err, io.EOF) { - return nil, fmt.Errorf("Dockerfile %q not found in context archive", dockerFile) + return nil, fmt.Errorf("dockerfile %q not found in context archive", dockerFile) } return nil, fmt.Errorf("reading tar archive: %w", err) @@ -405,22 +405,24 @@ func getAuthConfigsFromDockerfile(c *ContainerRequest) (map[string]registry.Auth } func (c *ContainerRequest) ShouldBuildImage() bool { - return c.FromDockerfile.Context != "" || c.FromDockerfile.ContextArchive != nil + return c.Context != "" || c.ContextArchive != nil } func (c *ContainerRequest) ShouldKeepBuiltImage() bool { - return c.FromDockerfile.KeepImage + return c.KeepImage } // BuildLogWriter returns the io.Writer for output of log when building a Docker image from // a Dockerfile. It returns the BuildLogWriter from the ContainerRequest, defaults to io.Discard. // For backward compatibility, if BuildLogWriter is default and PrintBuildLog is true, // the function returns os.Stderr. +// +//nolint:staticcheck //FIXME func (c *ContainerRequest) BuildLogWriter() io.Writer { if c.FromDockerfile.BuildLogWriter != nil { return c.FromDockerfile.BuildLogWriter } - if c.FromDockerfile.PrintBuildLog { + if c.PrintBuildLog { c.FromDockerfile.BuildLogWriter = os.Stderr } else { c.FromDockerfile.BuildLogWriter = io.Discard @@ -437,8 +439,8 @@ func (c *ContainerRequest) BuildOptions() (types.ImageBuildOptions, error) { ForceRemove: true, } - if c.FromDockerfile.BuildOptionsModifier != nil { - c.FromDockerfile.BuildOptionsModifier(&buildOptions) + if c.BuildOptionsModifier != nil { + c.BuildOptionsModifier(&buildOptions) } // apply mandatory values after the modifier @@ -505,7 +507,7 @@ func (c *ContainerRequest) BuildOptions() (types.ImageBuildOptions, error) { } func (c *ContainerRequest) validateContextAndImage() error { - if c.FromDockerfile.Context != "" && c.Image != "" { + if c.Context != "" && c.Image != "" { return errors.New("you cannot specify both an Image and Context in a ContainerRequest") } @@ -513,7 +515,7 @@ func (c *ContainerRequest) validateContextAndImage() error { } func (c *ContainerRequest) validateContextOrImageIsSpecified() error { - if c.FromDockerfile.Context == "" && c.FromDockerfile.ContextArchive == nil && c.Image == "" { + if c.Context == "" && c.ContextArchive == nil && c.Image == "" { return errors.New("you must specify either a build context or an image") } diff --git a/vendor/github.com/testcontainers/testcontainers-go/docker.go b/vendor/github.com/testcontainers/testcontainers-go/docker.go index 774a364..c578796 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/docker.go +++ b/vendor/github.com/testcontainers/testcontainers-go/docker.go @@ -186,7 +186,7 @@ func (c *DockerContainer) MappedPort(ctx context.Context, port nat.Port) (nat.Po if err != nil { return "", fmt.Errorf("inspect: %w", err) } - if inspect.ContainerJSONBase.HostConfig.NetworkMode == "host" { + if inspect.HostConfig.NetworkMode == "host" { return port, nil } @@ -1153,15 +1153,10 @@ func (p *DockerProvider) CreateContainer(ctx context.Context, req ContainerReque Env: env, Labels: req.Labels, Cmd: req.Cmd, - Hostname: req.Hostname, - User: req.User, - WorkingDir: req.WorkingDir, } hostConfig := &container.HostConfig{ - Privileged: req.Privileged, - ShmSize: req.ShmSize, - Tmpfs: req.Tmpfs, + Tmpfs: req.Tmpfs, } networkingConfig := &network.NetworkingConfig{} @@ -1271,7 +1266,7 @@ func (p *DockerProvider) findContainerByName(ctx context.Context, name string) ( // Note that, 'name' filter will use regex to find the containers filter := filters.NewArgs(filters.Arg("name", fmt.Sprintf("^%s$", name))) - containers, err := p.client.ContainerList(ctx, container.ListOptions{Filters: filter}) + containers, err := p.client.ContainerList(ctx, container.ListOptions{All: true, Filters: filter}) if err != nil { return nil, fmt.Errorf("container list: %w", err) } @@ -1369,6 +1364,23 @@ func (p *DockerProvider) ReuseOrCreateContainer(ctx context.Context, req Contain lifecycleHooks: []ContainerLifecycleHooks{combineContainerHooks(defaultHooks, req.LifecycleHooks)}, } + // If a container was stopped programmatically, we want to ensure the container + // is running again, but only if it is not paused, as it's not possible to start + // a paused container. The Docker Engine returns the "cannot start a paused container, + // try unpause instead" error. + switch c.State { + case "running": + // cannot re-start a running container, but we still need + // to call the startup hooks. + case "paused": + // TODO: we should unpause the container here. + return nil, fmt.Errorf("cannot start a paused container: %w", errors.ErrUnsupported) + default: + if err := dc.Start(ctx); err != nil { + return dc, fmt.Errorf("start container %s in state %s: %w", req.Name, c.State, err) + } + } + err = dc.startedHook(ctx) if err != nil { return nil, err @@ -1619,7 +1631,7 @@ func (p *DockerProvider) getGatewayIP(ctx context.Context, defaultNetwork string } } if ip == "" { - return "", errors.New("Failed to get gateway IP from network settings") + return "", errors.New("failed to get gateway IP from network settings") } return ip, nil diff --git a/vendor/github.com/testcontainers/testcontainers-go/docker_client.go b/vendor/github.com/testcontainers/testcontainers-go/docker_client.go index dd6d90e..e9eea1e 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/docker_client.go +++ b/vendor/github.com/testcontainers/testcontainers-go/docker_client.go @@ -76,7 +76,7 @@ func (c *DockerClient) Info(ctx context.Context) (system.Info, error) { log.Printf(infoMessage, packagePath, dockerInfo.ServerVersion, - c.Client.ClientVersion(), + c.ClientVersion(), dockerInfo.OperatingSystem, dockerInfo.MemTotal/1024/1024, infoLabels, internal.Version, diff --git a/vendor/github.com/testcontainers/testcontainers-go/docker_mounts.go b/vendor/github.com/testcontainers/testcontainers-go/docker_mounts.go index 7954b2b..9609d92 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/docker_mounts.go +++ b/vendor/github.com/testcontainers/testcontainers-go/docker_mounts.go @@ -1,6 +1,9 @@ package testcontainers import ( + "errors" + "path/filepath" + "github.com/docker/docker/api/types/mount" "github.com/testcontainers/testcontainers-go/log" @@ -11,6 +14,7 @@ var mountTypeMapping = map[MountType]mount.Type{ MountTypeVolume: mount.TypeVolume, MountTypeTmpfs: mount.TypeTmpfs, MountTypePipe: mount.TypeNamedPipe, + MountTypeImage: mount.TypeImage, } // Deprecated: use Files or HostConfigModifier in the ContainerRequest, or copy files container APIs to make containers portable across Docker environments @@ -32,6 +36,12 @@ type TmpfsMounter interface { GetTmpfsOptions() *mount.TmpfsOptions } +// ImageMounter can optionally be implemented by mount sources +// to support advanced scenarios based on mount.ImageOptions +type ImageMounter interface { + ImageOptions() *mount.ImageOptions +} + // Deprecated: use Files or HostConfigModifier in the ContainerRequest, or copy files container APIs to make containers portable across Docker environments type DockerBindMountSource struct { *mount.BindOptions @@ -85,6 +95,48 @@ func (s DockerTmpfsMountSource) GetTmpfsOptions() *mount.TmpfsOptions { return s.TmpfsOptions } +// DockerImageMountSource is a mount source for an image +type DockerImageMountSource struct { + // imageName is the image name + imageName string + + // subpath is the subpath to mount the image into + subpath string +} + +// NewDockerImageMountSource creates a new DockerImageMountSource +func NewDockerImageMountSource(imageName string, subpath string) DockerImageMountSource { + return DockerImageMountSource{ + imageName: imageName, + subpath: subpath, + } +} + +// Validate validates the source of the mount, ensuring that the subpath is a relative path +func (s DockerImageMountSource) Validate() error { + if !filepath.IsLocal(s.subpath) { + return errors.New("image mount source must be a local path") + } + return nil +} + +// ImageOptions returns the image options for the image mount +func (s DockerImageMountSource) ImageOptions() *mount.ImageOptions { + return &mount.ImageOptions{ + Subpath: s.subpath, + } +} + +// Source returns the image name for the image mount +func (s DockerImageMountSource) Source() string { + return s.imageName +} + +// Type returns the mount type for the image mount +func (s DockerImageMountSource) Type() MountType { + return MountTypeImage +} + // PrepareMounts maps the given []ContainerMount to the corresponding // []mount.Mount for further processing func (m ContainerMounts) PrepareMounts() []mount.Mount { @@ -118,6 +170,8 @@ func mapToDockerMounts(containerMounts ContainerMounts) []mount.Mount { containerMount.VolumeOptions = typedMounter.GetVolumeOptions() case TmpfsMounter: containerMount.TmpfsOptions = typedMounter.GetTmpfsOptions() + case ImageMounter: + containerMount.ImageOptions = typedMounter.ImageOptions() case BindMounter: log.Printf("Mount type %s is not supported by Testcontainers for Go", m.Source.Type()) default: diff --git a/vendor/github.com/testcontainers/testcontainers-go/generic.go b/vendor/github.com/testcontainers/testcontainers-go/generic.go index a081b52..9663b03 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/generic.go +++ b/vendor/github.com/testcontainers/testcontainers-go/generic.go @@ -117,3 +117,34 @@ func AddGenericLabels(target map[string]string) { target[k] = v } } + +// Run is a convenience function that creates a new container and starts it. +// It calls the GenericContainer function and returns a concrete DockerContainer type. +func Run(ctx context.Context, img string, opts ...ContainerCustomizer) (*DockerContainer, error) { + req := ContainerRequest{ + Image: img, + } + + genericContainerReq := GenericContainerRequest{ + ContainerRequest: req, + Started: true, + } + + for _, opt := range opts { + if err := opt.Customize(&genericContainerReq); err != nil { + return nil, fmt.Errorf("customize: %w", err) + } + } + + ctr, err := GenericContainer(ctx, genericContainerReq) + var c *DockerContainer + if ctr != nil { + c = ctr.(*DockerContainer) + } + + if err != nil { + return c, fmt.Errorf("generic container: %w", err) + } + + return c, nil +} diff --git a/vendor/github.com/testcontainers/testcontainers-go/internal/core/bootstrap.go b/vendor/github.com/testcontainers/testcontainers-go/internal/core/bootstrap.go index 201d4b0..d249d9b 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/internal/core/bootstrap.go +++ b/vendor/github.com/testcontainers/testcontainers-go/internal/core/bootstrap.go @@ -84,7 +84,7 @@ func init() { } hasher := sha256.New() - _, err = hasher.Write([]byte(fmt.Sprintf(sessionIDPlaceholder, parentPid, createTime))) + _, err = fmt.Fprintf(hasher, sessionIDPlaceholder, parentPid, createTime) if err != nil { sessionID = uuid.New().String() return diff --git a/vendor/github.com/testcontainers/testcontainers-go/internal/version.go b/vendor/github.com/testcontainers/testcontainers-go/internal/version.go index 7e6da64..6dba727 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/internal/version.go +++ b/vendor/github.com/testcontainers/testcontainers-go/internal/version.go @@ -1,4 +1,4 @@ package internal // Version is the next development version of the application -const Version = "0.36.0" +const Version = "0.37.0" diff --git a/vendor/github.com/testcontainers/testcontainers-go/lifecycle.go b/vendor/github.com/testcontainers/testcontainers-go/lifecycle.go index b6d8e25..72363cc 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/lifecycle.go +++ b/vendor/github.com/testcontainers/testcontainers-go/lifecycle.go @@ -521,6 +521,20 @@ func (c ContainerLifecycleHooks) Terminated(ctx context.Context) func(container } func (p *DockerProvider) preCreateContainerHook(ctx context.Context, req ContainerRequest, dockerInput *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig) error { + var mountErrors []error + for _, m := range req.Mounts { + // validate only the mount sources that implement the Validator interface + if v, ok := m.Source.(Validator); ok { + if err := v.Validate(); err != nil { + mountErrors = append(mountErrors, err) + } + } + } + + if len(mountErrors) > 0 { + return errors.Join(mountErrors...) + } + // prepare mounts hostConfig.Mounts = mapToDockerMounts(req.Mounts) @@ -548,9 +562,10 @@ func (p *DockerProvider) preCreateContainerHook(ctx context.Context, req Contain } } - if req.ConfigModifier != nil { - req.ConfigModifier(dockerInput) + if req.ConfigModifier == nil { + req.ConfigModifier = defaultConfigModifier(req) } + req.ConfigModifier(dockerInput) if req.HostConfigModifier == nil { req.HostConfigModifier = defaultHostConfigModifier(req) @@ -658,6 +673,15 @@ func mergePortBindings(configPortMap, exposedPortMap nat.PortMap, exposedPorts [ } // defaultHostConfigModifier provides a default modifier including the deprecated fields +func defaultConfigModifier(req ContainerRequest) func(config *container.Config) { + return func(config *container.Config) { + config.Hostname = req.Hostname + config.WorkingDir = req.WorkingDir + config.User = req.User + } +} + +// defaultHostConfigModifier provides a default modifier including the deprecated fields func defaultHostConfigModifier(req ContainerRequest) func(hostConfig *container.HostConfig) { return func(hostConfig *container.HostConfig) { hostConfig.AutoRemove = req.AutoRemove @@ -667,5 +691,7 @@ func defaultHostConfigModifier(req ContainerRequest) func(hostConfig *container. hostConfig.ExtraHosts = req.ExtraHosts hostConfig.NetworkMode = req.NetworkMode hostConfig.Resources = req.Resources + hostConfig.Privileged = req.Privileged + hostConfig.ShmSize = req.ShmSize } } diff --git a/vendor/github.com/testcontainers/testcontainers-go/mkdocs.yml b/vendor/github.com/testcontainers/testcontainers-go/mkdocs.yml index 8668ef5..99e8f4a 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/mkdocs.yml +++ b/vendor/github.com/testcontainers/testcontainers-go/mkdocs.yml @@ -68,6 +68,8 @@ nav: - Walk: features/wait/walk.md - Modules: - modules/index.md + - modules/aerospike.md + - modules/arangodb.md - modules/artemis.md - modules/azure.md - modules/azurite.md @@ -79,10 +81,12 @@ nav: - modules/couchbase.md - modules/databend.md - modules/dind.md + - modules/dockermodelrunner.md - modules/dolt.md - modules/dynamodb.md - modules/elasticsearch.md - modules/etcd.md + - modules/firebase.md - modules/gcloud.md - modules/grafana-lgtm.md - modules/inbucket.md @@ -114,7 +118,9 @@ nav: - modules/redpanda.md - modules/registry.md - modules/scylladb.md + - modules/socat.md - modules/surrealdb.md + - modules/toxiproxy.md - modules/valkey.md - modules/vault.md - modules/vearch.md @@ -123,7 +129,6 @@ nav: - Examples: - examples/index.md - examples/nginx.md - - examples/toxiproxy.md - System Requirements: - system_requirements/index.md - system_requirements/docker.md @@ -140,8 +145,9 @@ nav: - system_requirements/using_colima.md - system_requirements/using_podman.md - system_requirements/rancher.md + - Dependabot: dependabot.md - Contributing: contributing.md - Getting help: getting_help.md edit_uri: edit/main/docs/ extra: - latest_version: v0.36.0 + latest_version: v0.37.0 diff --git a/vendor/github.com/testcontainers/testcontainers-go/mounts.go b/vendor/github.com/testcontainers/testcontainers-go/mounts.go index a68e468..2e1d2c7 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/mounts.go +++ b/vendor/github.com/testcontainers/testcontainers-go/mounts.go @@ -1,12 +1,16 @@ package testcontainers -import "errors" +import ( + "errors" + "path/filepath" +) const ( MountTypeBind MountType = iota // Deprecated: Use MountTypeVolume instead MountTypeVolume MountTypeTmpfs MountTypePipe + MountTypeImage ) var ( @@ -18,6 +22,7 @@ var ( _ ContainerMountSource = (*GenericBindMountSource)(nil) // Deprecated: use Files or HostConfigModifier in the ContainerRequest, or copy files container APIs to make containers portable across Docker environments _ ContainerMountSource = (*GenericVolumeMountSource)(nil) _ ContainerMountSource = (*GenericTmpfsMountSource)(nil) + _ ContainerMountSource = (*GenericImageMountSource)(nil) ) type ( @@ -110,6 +115,15 @@ func VolumeMount(volumeName string, mountTarget ContainerMountTarget) ContainerM } } +// ImageMount returns a new ContainerMount with a GenericImageMountSource as source +// This is a convenience method to cover typical use cases. +func ImageMount(imageName string, subpath string, mountTarget ContainerMountTarget) ContainerMount { + return ContainerMount{ + Source: NewGenericImageMountSource(imageName, subpath), + Target: mountTarget, + } +} + // Mounts returns a ContainerMounts to support a more fluent API func Mounts(mounts ...ContainerMount) ContainerMounts { return mounts @@ -124,3 +138,38 @@ type ContainerMount struct { // ReadOnly determines if the mount should be read-only ReadOnly bool } + +// GenericImageMountSource implements ContainerMountSource and represents an image mount +type GenericImageMountSource struct { + // imageName refers to the name of the image to be mounted + // the same image might be mounted to multiple locations within a single container + imageName string + // subpath is the path within the image to be mounted + subpath string +} + +// NewGenericImageMountSource creates a new GenericImageMountSource +func NewGenericImageMountSource(imageName string, subpath string) GenericImageMountSource { + return GenericImageMountSource{ + imageName: imageName, + subpath: subpath, + } +} + +// Source returns the name of the image to be mounted +func (s GenericImageMountSource) Source() string { + return s.imageName +} + +// Type returns the type of the mount +func (GenericImageMountSource) Type() MountType { + return MountTypeImage +} + +// Validate validates the source of the mount +func (s GenericImageMountSource) Validate() error { + if !filepath.IsLocal(s.subpath) { + return errors.New("image mount source must be a local path") + } + return nil +} diff --git a/vendor/github.com/testcontainers/testcontainers-go/options.go b/vendor/github.com/testcontainers/testcontainers-go/options.go index f17de88..9afbcd7 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/options.go +++ b/vendor/github.com/testcontainers/testcontainers-go/options.go @@ -2,6 +2,7 @@ package testcontainers import ( "context" + "errors" "fmt" "net/url" "time" @@ -41,6 +42,15 @@ func CustomizeRequest(src GenericContainerRequest) CustomizeRequestOption { } } +// WithDockerfile allows to build a container from a Dockerfile +func WithDockerfile(df FromDockerfile) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.FromDockerfile = df + + return nil + } +} + // WithConfigModifier allows to override the default container config func WithConfigModifier(modifier func(config *container.Config)) CustomizeRequestOption { return func(req *GenericContainerRequest) error { @@ -96,7 +106,19 @@ func WithHostPortAccess(ports ...int) CustomizeRequestOption { } } -// Deprecated: the modules API forces passing the image as part of the signature of the Run function. +// WithReuseByName will mark a container to be reused if it exists or create a new one if it doesn't. +// A container name must be provided to identify the container to be reused. +func WithReuseByName(containerName string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + if containerName == "" { + return errors.New("container name must be provided for reuse") + } + req.Name = containerName + req.Reuse = true + return nil + } +} + // WithImage sets the image for a container func WithImage(image string) CustomizeRequestOption { return func(req *GenericContainerRequest) error { @@ -334,3 +356,104 @@ func WithWaitStrategyAndDeadline(deadline time.Duration, strategies ...wait.Stra return nil } } + +// WithImageMount mounts an image to a container, passing the source image name, +// the relative subpath to mount in that image, and the mount point in the target container. +// This option validates that the subpath is a relative path, raising an error otherwise. +func WithImageMount(source string, subpath string, target ContainerMountTarget) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + src := NewDockerImageMountSource(source, subpath) + + if err := src.Validate(); err != nil { + return fmt.Errorf("validate image mount source: %w", err) + } + + req.Mounts = append(req.Mounts, ContainerMount{ + Source: src, + Target: target, + }) + return nil + } +} + +// WithEntrypoint completely replaces the entrypoint of a container +func WithEntrypoint(entrypoint ...string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.Entrypoint = entrypoint + return nil + } +} + +// WithEntrypointArgs appends the entrypoint arguments to the entrypoint of a container +func WithEntrypointArgs(entrypointArgs ...string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.Entrypoint = append(req.Entrypoint, entrypointArgs...) + return nil + } +} + +// WithExposedPorts appends the ports to the exposed ports for a container +func WithExposedPorts(ports ...string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.ExposedPorts = append(req.ExposedPorts, ports...) + return nil + } +} + +// WithCmd completely replaces the command for a container +func WithCmd(cmd ...string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.Cmd = cmd + return nil + } +} + +// WithCmdArgs appends the command arguments to the command for a container +func WithCmdArgs(cmdArgs ...string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.Cmd = append(req.Cmd, cmdArgs...) + return nil + } +} + +// WithLabels appends the labels to the labels for a container +func WithLabels(labels map[string]string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + if req.Labels == nil { + req.Labels = make(map[string]string) + } + for k, v := range labels { + req.Labels[k] = v + } + return nil + } +} + +// WithMounts appends the mounts to the mounts for a container +func WithMounts(mounts ...ContainerMount) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.Mounts = append(req.Mounts, mounts...) + return nil + } +} + +// WithTmpfs appends the tmpfs mounts to the tmpfs mounts for a container +func WithTmpfs(tmpfs map[string]string) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + if req.Tmpfs == nil { + req.Tmpfs = make(map[string]string) + } + for k, v := range tmpfs { + req.Tmpfs[k] = v + } + return nil + } +} + +// WithFiles appends the files to the files for a container +func WithFiles(files ...ContainerFile) CustomizeRequestOption { + return func(req *GenericContainerRequest) error { + req.Files = append(req.Files, files...) + return nil + } +} diff --git a/vendor/github.com/testcontainers/testcontainers-go/port_forwarding.go b/vendor/github.com/testcontainers/testcontainers-go/port_forwarding.go index b9fc970..cd82361 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/port_forwarding.go +++ b/vendor/github.com/testcontainers/testcontainers-go/port_forwarding.go @@ -172,7 +172,7 @@ func exposeHostPorts(ctx context.Context, req *ContainerRequest, ports ...int) ( return sshdContainer.exposeHostPort(ctx, req.HostAccessPorts...) }, }, - PreStops: stopHooks, + PostStops: stopHooks, PreTerminates: stopHooks, } diff --git a/vendor/github.com/testcontainers/testcontainers-go/reaper.go b/vendor/github.com/testcontainers/testcontainers-go/reaper.go index 7b2d8b9..26cac14 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/reaper.go +++ b/vendor/github.com/testcontainers/testcontainers-go/reaper.go @@ -382,13 +382,13 @@ func (r *reaperSpawner) newReaper(ctx context.Context, sessionID string, provide Image: config.ReaperDefaultImage, ExposedPorts: []string{string(port)}, Labels: core.DefaultLabels(sessionID), - Privileged: tcConfig.RyukPrivileged, WaitingFor: wait.ForListeningPort(port), Name: reaperContainerNameFromSessionID(sessionID), HostConfigModifier: func(hc *container.HostConfig) { hc.AutoRemove = true hc.Binds = []string{dockerHostMount + ":/var/run/docker.sock"} hc.NetworkMode = Bridge + hc.Privileged = tcConfig.RyukPrivileged }, Env: map[string]string{}, } diff --git a/vendor/github.com/testcontainers/testcontainers-go/runtime.txt b/vendor/github.com/testcontainers/testcontainers-go/runtime.txt index cc1923a..24ee5b1 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/runtime.txt +++ b/vendor/github.com/testcontainers/testcontainers-go/runtime.txt @@ -1 +1 @@ -3.8 +3.13 diff --git a/vendor/github.com/testcontainers/testcontainers-go/testing.go b/vendor/github.com/testcontainers/testcontainers-go/testing.go index 017f1a4..1f41913 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/testing.go +++ b/vendor/github.com/testcontainers/testcontainers-go/testing.go @@ -53,6 +53,21 @@ func SkipIfDockerDesktop(t *testing.T, ctx context.Context) { } } +// SkipIfNotDockerDesktop is a utility function capable of skipping tests +// if tests are not run using Docker Desktop. +func SkipIfNotDockerDesktop(t *testing.T, ctx context.Context) { + t.Helper() + cli, err := NewDockerClientWithOpts(ctx) + require.NoErrorf(t, err, "failed to create docker client: %s", err) + + info, err := cli.Info(ctx) + require.NoErrorf(t, err, "failed to get docker info: %s", err) + + if info.OperatingSystem != "Docker Desktop" { + t.Skip("Skipping test that needs Docker Desktop") + } +} + // exampleLogConsumer { // StdoutLogConsumer is a LogConsumer that prints the log to stdout diff --git a/vendor/github.com/testcontainers/testcontainers-go/validator.go b/vendor/github.com/testcontainers/testcontainers-go/validator.go new file mode 100644 index 0000000..a888586 --- /dev/null +++ b/vendor/github.com/testcontainers/testcontainers-go/validator.go @@ -0,0 +1,7 @@ +package testcontainers + +// Validator is an interface that can be implemented by types that need to validate their state. +type Validator interface { + // Validate validates the state of the type. + Validate() error +} diff --git a/vendor/github.com/testcontainers/testcontainers-go/wait/all.go b/vendor/github.com/testcontainers/testcontainers-go/wait/all.go index fb7eb4e..9bf4cbe 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/wait/all.go +++ b/vendor/github.com/testcontainers/testcontainers-go/wait/all.go @@ -3,6 +3,7 @@ package wait import ( "context" "errors" + "reflect" "time" ) @@ -62,6 +63,13 @@ func (ms *MultiStrategy) WaitUntilReady(ctx context.Context, target StrategyTarg } for _, strategy := range ms.Strategies { + if strategy == nil || reflect.ValueOf(strategy).IsNil() { + // A module could be appending strategies after part of the container initialization, + // and use wait.ForAll on a not initialized strategy. + // In this case, we just skip the nil strategy. + continue + } + strategyCtx := ctx // Set default Timeout when strategy implements StrategyTimeout diff --git a/vendor/github.com/testcontainers/testcontainers-go/wait/http.go b/vendor/github.com/testcontainers/testcontainers-go/wait/http.go index 2c7c655..32dc877 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/wait/http.go +++ b/vendor/github.com/testcontainers/testcontainers-go/wait/http.go @@ -208,7 +208,7 @@ func (ws *HTTPStrategy) WaitUntilReady(ctx context.Context, target StrategyTarge } if lowestPort == "" { - return errors.New("No exposed tcp ports or mapped ports - cannot wait for status") + return errors.New("no exposed tcp ports or mapped ports - cannot wait for status") } mappedPort, _ = nat.NewPort(lowestPort.Proto(), hostPort) @@ -229,7 +229,7 @@ func (ws *HTTPStrategy) WaitUntilReady(ctx context.Context, target StrategyTarge } if mappedPort.Proto() != "tcp" { - return errors.New("Cannot use HTTP client on non-TCP ports") + return errors.New("cannot use HTTP client on non-TCP ports") } } diff --git a/vendor/github.com/testcontainers/testcontainers-go/wait/walk.go b/vendor/github.com/testcontainers/testcontainers-go/wait/walk.go index 4685e50..009e563 100644 --- a/vendor/github.com/testcontainers/testcontainers-go/wait/walk.go +++ b/vendor/github.com/testcontainers/testcontainers-go/wait/walk.go @@ -5,18 +5,24 @@ import ( ) var ( - // VisitStop is used as a return value from [VisitFunc] to stop the walk. + // ErrVisitStop is used as a return value from [VisitFunc] to stop the walk. // It is not returned as an error by any function. - VisitStop = errors.New("stop the walk") + ErrVisitStop = errors.New("stop the walk") - // VisitRemove is used as a return value from [VisitFunc] to have the current node removed. + // Deprecated: use [ErrVisitStop] instead. + VisitStop = ErrVisitStop + + // ErrVisitRemove is used as a return value from [VisitFunc] to have the current node removed. // It is not returned as an error by any function. - VisitRemove = errors.New("remove this strategy") + ErrVisitRemove = errors.New("remove this strategy") + + // Deprecated: use [ErrVisitRemove] instead. + VisitRemove = ErrVisitRemove ) // VisitFunc is a function that visits a strategy node. -// If it returns [VisitStop], the walk stops. -// If it returns [VisitRemove], the current node is removed. +// If it returns [ErrVisitStop], the walk stops. +// If it returns [ErrVisitRemove], the current node is removed. type VisitFunc func(root Strategy) error // Walk walks the strategies tree and calls the visit function for each node. @@ -26,7 +32,7 @@ func Walk(root *Strategy, visit VisitFunc) error { } if err := walk(root, visit); err != nil { - if errors.Is(err, VisitRemove) || errors.Is(err, VisitStop) { + if errors.Is(err, ErrVisitRemove) || errors.Is(err, ErrVisitStop) { return nil } return err @@ -45,7 +51,7 @@ func walk(root *Strategy, visit VisitFunc) error { // Allow the visit function to customize the behaviour of the walk before visiting the children. if err := visit(*root); err != nil { - if errors.Is(err, VisitRemove) { + if errors.Is(err, ErrVisitRemove) { *root = nil } @@ -56,7 +62,7 @@ func walk(root *Strategy, visit VisitFunc) error { var i int for range s.Strategies { if err := walk(&s.Strategies[i], visit); err != nil { - if errors.Is(err, VisitRemove) { + if errors.Is(err, ErrVisitRemove) { s.Strategies = append(s.Strategies[:i], s.Strategies[i+1:]...) if errors.Is(err, VisitStop) { return VisitStop |
