From 55bc30a78446afc665e880e23d85fd996f3de394 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 2 Mar 2025 13:16:24 +0100 Subject: [PATCH] cli/command/image: use t.SetEnv in trust tests Signed-off-by: Sebastiaan van Stijn --- cli/command/image/trust_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/command/image/trust_test.go b/cli/command/image/trust_test.go index 59e58e193e..1846ceba37 100644 --- a/cli/command/image/trust_test.go +++ b/cli/command/image/trust_test.go @@ -5,11 +5,10 @@ import ( "github.com/docker/cli/cli/trust" registrytypes "github.com/docker/docker/api/types/registry" - "gotest.tools/v3/env" ) func TestENVTrustServer(t *testing.T) { - env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "https://notary-test.example.com:5000"}) + t.Setenv("DOCKER_CONTENT_TRUST_SERVER", "https://notary-test.example.com:5000") indexInfo := ®istrytypes.IndexInfo{Name: "testserver"} output, err := trust.Server(indexInfo) expectedStr := "https://notary-test.example.com:5000" @@ -19,7 +18,7 @@ func TestENVTrustServer(t *testing.T) { } func TestHTTPENVTrustServer(t *testing.T) { - env.PatchAll(t, map[string]string{"DOCKER_CONTENT_TRUST_SERVER": "http://notary-test.example.com:5000"}) + t.Setenv("DOCKER_CONTENT_TRUST_SERVER", "http://notary-test.example.com:5000") indexInfo := ®istrytypes.IndexInfo{Name: "testserver"} _, err := trust.Server(indexInfo) if err == nil {