mirror of
https://github.com/stakater/Reloader.git
synced 2026-05-20 07:32:51 +00:00
Refactor code
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user