Documentation ¶
Index ¶
Constants ¶
View Source
const (
MinSizeToReport = 30 * 1024 * 1024 // 30MB
)
Variables ¶
View Source
var ( Workloads = mapset.NewSet[string]([]string{ "cronjob", "daemonset", "deployment", "job", "pod", "replicaset", "service", "statefulset", }...) // FIXME put in a configmap )
Functions ¶
func NewKubernetesClient ¶
func NewKubernetesClient() (dynamic.Interface, discovery.DiscoveryInterface, error)
Types ¶
type KubernetesAPI ¶
func NewKubernetesAPI ¶
func NewKubernetesAPI(client dynamic.Interface, discovery discovery.DiscoveryInterface) *KubernetesAPI
func (*KubernetesAPI) FetchResources ¶
func (h *KubernetesAPI) FetchResources() (ResourceMaps, error)
FetchResources builds a map of running resources in the cluster needed for cleanup
type ResourceMaps ¶
type ResourceMaps struct { RunningWlidsToContainerNames *maps.SafeMap[string, mapset.Set[string]] RunningInstanceIds mapset.Set[string] RunningContainerImageIds mapset.Set[string] RunningTemplateHash mapset.Set[string] }
ResourceMaps is a map of running resources in the cluster, based on these maps we can decide which files to delete
type ResourcesCleanupHandler ¶
type ResourcesCleanupHandler struct {
// contains filtered or unexported fields
}
func NewResourcesCleanupHandler ¶
func NewResourcesCleanupHandler(appFs afero.Fs, root string, pool *sqlitemigration.Pool, interval time.Duration, fetcher ResourcesFetcher) *ResourcesCleanupHandler
func (*ResourcesCleanupHandler) StartCleanupTask ¶
func (h *ResourcesCleanupHandler) StartCleanupTask(ctx context.Context)
type ResourcesFetcher ¶
type ResourcesFetcher interface {
FetchResources() (ResourceMaps, error)
}
type TypeCleanupHandlerFunc ¶
type TypeCleanupHandlerFunc func(kind, path string, metadata *metav1.ObjectMeta, resourceMaps ResourceMaps) bool
type TypeDeleteFunc ¶ added in v0.0.89
Click to show internal directories.
Click to hide internal directories.