Skip to content

Commit a6bfa55

Browse files
committed
Using t.Setenv instead of os.Setenv
1 parent 44f8364 commit a6bfa55

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

test/integration/addons_test.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ func TestAddons(t *testing.T) {
6868
}
6969

7070
// MOCK_GOOGLE_TOKEN forces the gcp-auth webhook to use a mock token instead of trying to get a valid one from the credentials.
71-
err = os.Setenv("MOCK_GOOGLE_TOKEN", "true")
72-
t.Cleanup(func() {
73-
os.Unsetenv("MOCK_GOOGLE_TOKEN")
74-
})
75-
if err != nil {
76-
t.Fatalf("Failed setting MOCK_GOOGLE_TOKEN env var: %v", err)
77-
}
71+
t.Setenv("MOCK_GOOGLE_TOKEN", "true")
7872

7973
args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=volumesnapshots", "--addons=csi-hostpath-driver", "--addons=gcp-auth", "--addons=cloud-spanner"}, StartArgs()...)
8074
if !NoneDriver() { // none driver does not support ingress

0 commit comments

Comments
 (0)