Restore env vars after test

pull/1421/head
YuviPanda 2025-02-28 13:29:09 -08:00
rodzic 3e458e3299
commit 1bd3d276f3
1 zmienionych plików z 13 dodań i 6 usunięć

Wyświetl plik

@ -112,6 +112,10 @@ def test_registry(registry, dind):
r2d = make_r2d(["--image", image_name, "--push", "--no-run", str(HERE)])
docker_host, cert_dir = dind
old_environ = os.environ.copy()
try:
os.environ["DOCKER_HOST"] = docker_host
os.environ["DOCKER_CERT_PATH"] = str(cert_dir / "client")
os.environ["DOCKER_TLS_VERIFY"] = "1"
@ -119,3 +123,6 @@ def test_registry(registry, dind):
proc = subprocess.run(["docker", "manifest", "inspect", "--insecure", image_name])
assert proc.returncode == 0
finally:
os.environ.clear()
os.environ.update(old_environ)