Repository navigation
e2e: forward Docker TLS environment variables to the tests - #14524
Merged
ndeloof merged 2 commits intoNov 18, 2026
Merged
Conversation
Contributor
Author
|
This makes other tests fail. Sigh. |
BaseEnvironment() forwards DOCKER_HOST to the docker and compose commands run by the e2e tests, but not the variables that go with a TLS endpoint. With DOCKER_HOST=tcp://host:2376 and DOCKER_TLS_VERIFY=1 set, the tests talk plain HTTP to the daemon and fail with "Client sent an HTTP request to an HTTPS server". Forward DOCKER_TLS_VERIFY, DOCKER_CERT_PATH and DOCKER_API_VERSION too. Signed-off-by: Ricardo Branco <rbranco@suse.de>
ricardobranco777
force-pushed
the
e2e-forward-docker-tls-env
branch
from
November 18, 2026 11:05
748d452 to
7068f65
Compare
…ronment "docker buildx create" refuses to use the default context when its TLS data is loaded from DOCKER_TLS_VERIFY/DOCKER_CERT_PATH: could not create a builder instance with TLS data loaded from environment. Please use `docker context create <context-name>` ... Now that these variables are forwarded to the tests, add a CreateBuilder helper that copies the default context to a "<builder>-ctx" context and creates the builder on it when TLS is configured through the environment. The context cannot share the builder's name because buildx treats every context as an implicit builder. Use it in the four tests that create a builder: TestBuildPlatformsWithCorrectBuildxConfig, TestBuildPrivileged, TestBuildBuilder and TestBuildEntitlements. Signed-off-by: Ricardo Branco <rbranco@suse.de>
ricardobranco777
force-pushed
the
e2e-forward-docker-tls-env
branch
from
November 18, 2026 11:26
7068f65 to
dc79760
Compare
Contributor
Author
|
Verification run in openQA: |
ndeloof
approved these changes
Nov 18, 2026
| t.Helper() | ||
| create := []string{"buildx", "create", "--name", name, "--use", "--bootstrap"} | ||
| create = append(create, args...) | ||
| if os.Getenv("DOCKER_TLS_VERIFY") != "" || os.Getenv("DOCKER_CERT_PATH") != "" { |
Contributor
There was a problem hiding this comment.
nit: DOCKER_TLS_VERIFY=0 (an explicit opt-out) also takes this branch since only emptiness is tested. Harmless (the copied context just carries no TLS), but os.Getenv("DOCKER_CERT_PATH") != "" || os.Getenv("DOCKER_TLS_VERIFY") == "1" would match the daemon's own semantics more closely.
ndeloof
enabled auto-merge (rebase)
November 18, 2026 14:18
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the tests when running on TLS-enabled daemons. Broken since v5.7.1. Tested with v5.8.0.
What this PR does
BaseEnvironment() forwards DOCKER_HOST to the docker and compose commands run by the e2e tests, but not the variables that go with a TLS endpoint. With DOCKER_HOST=tcp://host:2376 and DOCKER_TLS_VERIFY=1 set, the tests talk plain HTTP to the daemon and fail with "Client sent an HTTP request to an HTTPS server".
Otherwise tests fail in openQA since docker-compose v5.7.1:
https://openqa.opensuse.org/tests/6345435/logfile?filename=docker_compose-e2e-compose.txt
Related issue
Fixes #
Changes made
Testing done
make testmake e2e-composeormake e2e-compose-standalonemake lintmake fmtAdditional context
(not mandatory) A picture of a cute animal, if possible in relation to what you did