kubernetes/pkg/controller/garbagecollector/garbagecollector_test.go

type testRESTMapper

func (m *testRESTMapper) Reset() {}

func TestGarbageCollectorConstruction(t *testing.T) {}

type fakeAction

// String returns method=path to aid in testing
func (f *fakeAction) String() string {}

type FakeResponse

type fakeActionHandler

// ServeHTTP logs the action that occurred and always returns the associated status code
func (f *fakeActionHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) {}

// testServerAndClientConfig returns a server that listens and a config that can reference it
func testServerAndClientConfig(handler func(http.ResponseWriter, *http.Request)) (*httptest.Server, *restclient.Config) {}

type garbageCollector

func setupGC(t *testing.T, config *restclient.Config) garbageCollector {}

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

func serilizeOrDie(t *testing.T, object interface{}

// test the attemptToDeleteItem function making the expected actions.
func TestAttemptToDeleteItem(t *testing.T) {}

// verifyGraphInvariants verifies that all of a node's owners list the node as a
// dependent and vice versa. uidToNode has all the nodes in the graph.
func verifyGraphInvariants(scenario string, uidToNode map[types.UID]*node, t *testing.T) {}

func createEvent(eventType eventType, selfUID string, owners []string) event {}

func TestProcessEvent(t *testing.T) {}

func BenchmarkReferencesDiffs(t *testing.B) {}

// TestDependentsRace relies on golang's data race detector to check if there is
// data race among in the dependents field.
func TestDependentsRace(t *testing.T) {}

func podToGCNode(pod *v1.Pod) *node {}

func TestAbsentOwnerCache(t *testing.T) {}

func TestDeleteOwnerRefPatch(t *testing.T) {}

func TestUnblockOwnerReference(t *testing.T) {}

func TestOrphanDependentsFailure(t *testing.T) {}

// TestGetDeletableResources ensures GetDeletableResources always returns
// something usable regardless of discovery output.
func TestGetDeletableResources(t *testing.T) {}

// TestGarbageCollectorSync ensures that a discovery client error
// or an informer sync error will not cause the garbage collector
// to block infinitely.
func TestGarbageCollectorSync(t *testing.T) {}

func assertMonitors(t *testing.T, gc *GarbageCollector, resources ...string) {}

func expectSyncNotBlocked(fakeDiscoveryClient *fakeServerResources) error {}

type fakeServerResources

func (*fakeServerResources) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) {}

func (*fakeServerResources) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) {}

func (f *fakeServerResources) ServerPreferredResources() ([]*metav1.APIResourceList, error) {}

func (f *fakeServerResources) setPreferredResources(resources []*metav1.APIResourceList, err error) {}

func (f *fakeServerResources) getInterfaceUsedCount() int {}

func (*fakeServerResources) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) {}

func TestConflictingData(t *testing.T) {}

func makeID(groupVersion string, kind string, namespace, name, uid string) objectReference {}

type nodeTweak

func virtual(n *node) *node {}

func withOwners(ownerReferences ...objectReference) nodeTweak {}

func makeNode(identity objectReference, tweaks ...nodeTweak) *node {}

func makeAddEvent(identity objectReference, owners ...objectReference) *event {}

func makeVirtualDeleteEvent(identity objectReference, owners ...objectReference) *event {}

func makeDeleteEvent(identity objectReference, owners ...objectReference) *event {}

func makeObj(identity objectReference, owners ...objectReference) *metaonly.MetadataOnlyObject {}

func makeMetadataObj(identity objectReference, owners ...objectReference) *metav1.PartialObjectMetadata {}

type stepContext

type step

func processPendingGraphChanges(count int) step {}

func processAttemptToDelete(count int) step {}

func insertEvent(e *event) step {}

func processEvent(e *event) step {}

func createObjectInClient(group, version, resource, namespace string, obj *metav1.PartialObjectMetadata) step {}

func deleteObjectFromClient(group, version, resource, namespace, name string) step {}

type state

func assertState(s state) step {}

type trackingWorkqueue

var _

func newTrackingWorkqueue[T comparable]() *trackingWorkqueue[T] {}

func (t *trackingWorkqueue[T]) Add(item T) {}

func (t *trackingWorkqueue[T]) AddAfter(item T, duration time.Duration) {}

func (t *trackingWorkqueue[T]) AddRateLimited(item T) {}

func (t *trackingWorkqueue[T]) Get() (T, bool) {}

func (t *trackingWorkqueue[T]) Done(item T) {}

func (t *trackingWorkqueue[T]) Forget(item T) {}

func (t *trackingWorkqueue[T]) NumRequeues(item T) int {}

func (t *trackingWorkqueue[T]) Len() int {}

func (t *trackingWorkqueue[T]) ShutDown() {}

func (t *trackingWorkqueue[T]) ShutDownWithDrain() {}

func (t *trackingWorkqueue[T]) ShuttingDown() bool {}

func (t *trackingWorkqueue[T]) queue(item T) {}

func (t *trackingWorkqueue[T]) dequeue(item T) {}