kubernetes/test/integration/garbagecollector/garbage_collector_test.go

func getForegroundOptions() metav1.DeleteOptions {}

func getOrphanOptions() metav1.DeleteOptions {}

func getPropagateOrphanOptions() metav1.DeleteOptions {}

func getNonOrphanOptions() metav1.DeleteOptions {}

const garbageCollectedPodName

const independentPodName

const oneValidOwnerPodName

const toBeDeletedRCName

const remainingRCName

var testCert

func newPod(podName, podNamespace string, ownerReferences []metav1.OwnerReference) *v1.Pod {}

func newOwnerRC(name, namespace string) *v1.ReplicationController {}

func newCRDInstance(definition *apiextensionsv1.CustomResourceDefinition, namespace, name string) *unstructured.Unstructured {}

func newConfigMap(namespace, name string) *v1.ConfigMap {}

func link(t *testing.T, owner, dependent metav1.Object) {}

func createRandomCustomResourceDefinition(
	t *testing.T, apiExtensionClient apiextensionsclientset.Interface,
	dynamicClient dynamic.Interface,
	namespace string,
) (*apiextensionsv1.CustomResourceDefinition, dynamic.ResourceInterface) {}

type testContext

// if workerCount > 0, will start the GC, otherwise it's up to the caller to Run() the GC.
func setup(t *testing.T, workerCount int) *testContext {}

func setupWithServer(t *testing.T, result *kubeapiservertesting.TestServer, workerCount int) *testContext {}

func createNamespaceOrDie(name string, c clientset.Interface, t *testing.T) *v1.Namespace {}

func deleteNamespaceOrDie(name string, c clientset.Interface, t *testing.T) {}

func TestCrossNamespaceReferencesWithWatchCache(t *testing.T) {}

func TestCrossNamespaceReferencesWithoutWatchCache(t *testing.T) {}

func testCrossNamespaceReferences(t *testing.T, watchCache bool) {}

// This test simulates the cascading deletion.
func TestCascadingDeletion(t *testing.T) {}

// This test simulates the case where an object is created with an owner that
// doesn't exist. It verifies the GC will delete such an object.
func TestCreateWithNonExistentOwner(t *testing.T) {}

func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet clientset.Interface, nameSuffix, namespace string, initialFinalizers []string, options metav1.DeleteOptions, wg *sync.WaitGroup, rcUIDs chan types.UID, errs chan string) {}

func verifyRemainingObjects(t *testing.T, clientSet clientset.Interface, namespace string, rcNum, podNum int) (bool, error) {}

// The stress test is not very stressful, because we need to control the running
// time of our pre-submit tests to increase submit-queue throughput. We'll add
// e2e tests that put more stress.
func TestStressingCascadingDeletion(t *testing.T) {}

func TestOrphaning(t *testing.T) {}

func TestSolidOwnerDoesNotBlockWaitingOwner(t *testing.T) {}

func TestNonBlockingOwnerRefDoesNotBlock(t *testing.T) {}

func TestDoubleDeletionWithFinalizer(t *testing.T) {}

func TestBlockingOwnerRefDoesBlock(t *testing.T) {}

// TestCustomResourceCascadingDeletion ensures the basic cascading delete
// behavior supports custom resources.
func TestCustomResourceCascadingDeletion(t *testing.T) {}

// TestMixedRelationships ensures that owner/dependent relationships work
// between core and custom resources.
//
// TODO: Consider how this could be represented with table-style tests (e.g. a
// before/after expected object graph given a delete operation targeting a
// specific node in the before graph with certain delete options).
func TestMixedRelationships(t *testing.T) {}

// TestCRDDeletionCascading ensures propagating deletion of a custom resource
// definition with an instance that owns a core resource.
func TestCRDDeletionCascading(t *testing.T) {}

func testCRDDeletion(t *testing.T, ctx *testContext, ns *v1.Namespace, definition *apiextensionsv1.CustomResourceDefinition, resourceClient dynamic.ResourceInterface) {}

// TestCascadingDeleteOnCRDConversionFailure tests that a bad conversion webhook cannot block the entire GC controller.
// Historically, a cache sync failure from a single resource prevented GC controller from running. This test creates
// a CRD, updates the storage version with a bad conversion webhook and then runs a simple cascading delete test.
func TestCascadingDeleteOnCRDConversionFailure(t *testing.T) {}