Simplify Create/Delete-TestingNamespace functions

This commit is contained in:
Wojciech Tyczyński
2022-05-15 15:33:19 +02:00
parent 9720d130e4
commit deef9e40de
35 changed files with 326 additions and 333 deletions

View File

@@ -21,7 +21,6 @@ package framework
import (
"context"
"fmt"
"net/http/httptest"
"strings"
"testing"
"time"
@@ -46,7 +45,7 @@ const (
)
// CreateTestingNamespace creates a namespace for testing.
func CreateTestingNamespace(baseName string, apiserver *httptest.Server, t *testing.T) *v1.Namespace {
func CreateTestingNamespace(baseName string, t *testing.T) *v1.Namespace {
// TODO: Create a namespace with a given basename.
// Currently we neither create the namespace nor delete all of its contents at the end.
// But as long as tests are not using the same namespaces, this should work fine.
@@ -61,7 +60,7 @@ func CreateTestingNamespace(baseName string, apiserver *httptest.Server, t *test
}
// DeleteTestingNamespace is currently a no-op function.
func DeleteTestingNamespace(ns *v1.Namespace, apiserver *httptest.Server, t *testing.T) {
func DeleteTestingNamespace(ns *v1.Namespace, t *testing.T) {
// TODO: Remove all resources from a given namespace once we implement CreateTestingNamespace.
// Note: integration tests are not expected to run against persistent fixtures today, so not
// cleaning up data they create has no impact.