Skip to content

Commit 87e8cc0

Browse files
fix: ensure certs do not exist
Signed-off-by: nelson.parente <nelson_parente@live.com.pt>
1 parent 68287b1 commit 87e8cc0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/e2e/common/common.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,11 @@ func MTLSTestOnInstallUpgrade(opts TestOptions) func(t *testing.T) {
313313
}
314314

315315
// export
316-
// check that the dir does not exist now.
316+
// ensure the dir does not exist before export.
317+
err = os.RemoveAll("./certs")
318+
if err != nil {
319+
t.Logf("error removing existing certs directory: %s", err.Error())
320+
}
317321
_, err = os.Stat("./certs")
318322
if assert.Error(t, err) {
319323
assert.True(t, os.IsNotExist(err), err.Error())
@@ -1251,8 +1255,7 @@ func waitAllPodsRunning(t *testing.T, namespace string, haEnabled bool, done, po
12511255
default:
12521256
break
12531257
}
1254-
ctx := t.Context()
1255-
ctxt, cancel := context.WithTimeout(ctx, 10*time.Second)
1258+
ctxt, cancel := context.WithTimeout(context.Background(), 10*time.Second)
12561259

12571260
k8sClient, err := getClient()
12581261
require.NoError(t, err, "error getting k8s client for pods check")

0 commit comments

Comments
 (0)