Refactor code

Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
This commit is contained in:
faizanahmad055
2026-05-11 16:18:53 +02:00
parent e8d79c61c8
commit b5c8705395
17 changed files with 222 additions and 118 deletions

View File

@@ -32,10 +32,13 @@ type TestEnvironment struct {
}
// SetupTestEnvironment creates a new test environment with kubernetes clients.
// It creates a unique namespace with the given prefix.
// It creates a unique namespace with the given prefix. The returned env.Cancel must be
// called (e.g., in AfterSuite) to release the child context after env.Cleanup() completes.
func SetupTestEnvironment(ctx context.Context, namespacePrefix string) (*TestEnvironment, error) {
childCtx, cancel := context.WithCancel(ctx)
env := &TestEnvironment{
Ctx: ctx,
Ctx: childCtx,
Cancel: cancel,
TestImage: GetTestImage(),
}