k8sgc

package
v2.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package k8sgc implements a basic for of garbage collection on the Kubernetes API.

This job is normally performed by the controller-manager. The component is not available in a test setting, with only the basic API server deployed. This is where k8sgc comes in to fill the gap, so deletion of objects can be tested as expected.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GC

type GC interface {
	// Run the garbage collector until all orphaned resources are collected.
	// Returns true if any resources where collected.
	Run(ctx context.Context) (bool, error)
}

GC offers a basic form of garbage collection for Kubernetes resources

func New

func New(ctx context.Context, cl client.Client) (GC, error)

New creates a new GC using the passed kubernetes client. The GC will watch all resources for which the client has a Scheme.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL