use ginkgo.DeferCleanup to do cleanup tasks

This commit is contained in:
carlory 2024-11-06 01:02:09 +08:00 committed by Stanislav Láznička
parent 129418b9a9
commit c9bfc3b455
No known key found for this signature in database
GPG Key ID: F8D8054395A1D157

View File

@ -270,11 +270,11 @@ var _ = SIGDescribe(feature.ClusterTrustBundle, feature.ClusterTrustBundleProjec
var cleanups []func(ctx context.Context)
var projections []v1.VolumeProjection
defer func() {
ginkgo.DeferCleanup(func(ctx context.Context) {
for _, c := range cleanups {
c(ctx)
}
}()
})
for i := range numCTBs {
ctb := ctbForCA(fmt.Sprintf("test.test:signer-hundreds:%d", i), "test.test/signer-hundreds", mustMakeCAPEM(fmt.Sprintf("root%d", i)), nil)
initCTBs = append(initCTBs, ctb)