Unset the env var before func return in Unit Test

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
(cherry picked from commit 141f2dd501)
pull/10808/head
Kay Yan 3 years ago committed by Matt Farina
parent 18fa1d739f
commit 9499df01bb
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9

@ -177,7 +177,7 @@ func (o *repoAddOptions) run(out io.Writer) error {
InsecureSkipTLSverify: o.insecureSkipTLSverify, InsecureSkipTLSverify: o.insecureSkipTLSverify,
} }
// Check If the repo name is legal // Check if the repo name is legal
if strings.Contains(o.name, "/") { if strings.Contains(o.name, "/") {
return errors.Errorf("repository name (%s) contains '/', please specify a different name without '/'", o.name) return errors.Errorf("repository name (%s) contains '/', please specify a different name without '/'", o.name)
} }

@ -137,6 +137,8 @@ func TestRepoAddCheckLegalName(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
defer ts.Stop() defer ts.Stop()
defer resetEnv()()
const testRepoName = "test-hub/test-name" const testRepoName = "test-hub/test-name"
rootDir := ensure.TempDir(t) rootDir := ensure.TempDir(t)

Loading…
Cancel
Save